sharing everything

C/C++ : Adding Searching Include Directory

I have compiled a source code (Opendtect) using CMake. When I compile this program, the required include directory is not exist in the C/C++ searching path. Modified the Makefile is very hard, because this is the other people code.

We can copy all the include library to default C/C++ include directory (/usr/include). But, I dont recomended this. The other good method is adding searching include directory for my compiler. I get a documentation from gnu website about this :

The GNU have some of variable to adding new Include path directory to our program. Example, if we want to add new path include directory to our C++ code, we can use a command like this :

We can add this command to our user path (/home/username/.bashrc) to make permanent or only use this command in current console.

Source :
http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Environment-Variables.html#Environment-Variables
My name is Toto Sugito. This is my notes when I try something. Maybe, this is NOT THE BEST SOLUTION for your problems. If you have other method or idea that better with my post, please share in this blog. Thank for visiting my site.

No Comments Yet

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Categories

Bloggers - Meet Millions of Bloggers