DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Set the include path (http://www.daniweb.com/forums/thread159398.html)

karang Nov 25th, 2008 7:13 am
Set the include path
 
Hi

How can I set the include path in C++ using command line

Regards
Karan

ithelp Nov 25th, 2008 7:16 am
Re: Set the include path
 
Include path of what ? I guess you need to add it in your makefile.

karang Nov 25th, 2008 7:22 am
Re: Set the include path
 
Hi
Let me elaborate it
I have opened a VC++.net project

When I compile the project I am getting an error.

fatal error C1083: Cannot open include file: 'Test/Testnamespaces.h': No such file or directory

Now I have created a folder 'Test' and add a header file 'Testnamespaces.h'.

But still I am getting the same error.

Laiq Ahmed Nov 25th, 2008 7:30 am
Re: Set the include path
 
The Question is where you've Created the Test Folder. Place with your code files. it will identify the header file in that folder then.

karang Nov 25th, 2008 7:31 am
Re: Set the include path
 
Hi

I have created the folder in the root folder of the project.

Regards
Karan

Murtan Nov 25th, 2008 11:55 am
Re: Set the include path
 
If the include line looks like:
#include "Test/Testnamespaces.h"
it should look for the Test directory in the same directory the source file was located in, or in the include path.

If you used:
#include <Test/Testnamespaces.h>
the compiler will not look in the source file's directory first.

Which style of include did you use?

If this doesn't help, the relevant section from your code would be useful as well as the project directory listing to demonstrate where the files are located in relation to each other.

serkan sendur Dec 17th, 2008 12:57 pm
Re: Set the include path
 
how to specify include path when compiling c++ files?

serkan sendur Dec 17th, 2008 3:25 pm
Re: Set the include path
 
here is a good link on how to set search paths when compiling c++
http://www.network-theory.co.uk/docs...cintro_24.html


All times are GMT -4. The time now is 11:37 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC