"Cannot open include file" 
Author Message
 "Cannot open include file"

I'm new to VC++ and am in the process of creating a Win 32
Static Library.

I am using this library to encapsulate a class that I
created in another project workspace.  I used
the "Project|Add to Project|Files|filename" to add both
the .cpp and the .h files to the workspace.  I can see
them in the workspace.

However, in order to use this class elsewhere in my new
library, I need to #include the header file.  Heres the
error:

C:\My Documents\Backup\Backup3\VCC_Projects\Day16
\ModArt.cpp(7) : fatal error C1083: Cannot open include
file: 'Line.h': No such file or directory

I can see the header file in the project workspace, why
can I not include it?  Is there some sort of build option
that I need to set to make sure it is in the search path?

Any help appreciated.



Sun, 09 Oct 2005 19:09:43 GMT  
 "Cannot open include file"
Are you using <> or "" around the filename?


Quote:
> I'm new to VC++ and am in the process of creating a Win 32
> Static Library.

> I am using this library to encapsulate a class that I
> created in another project workspace.  I used
> the "Project|Add to Project|Files|filename" to add both
> the .cpp and the .h files to the workspace.  I can see
> them in the workspace.

> However, in order to use this class elsewhere in my new
> library, I need to #include the header file.  Heres the
> error:

> C:\My Documents\Backup\Backup3\VCC_Projects\Day16
> \ModArt.cpp(7) : fatal error C1083: Cannot open include
> file: 'Line.h': No such file or directory

> I can see the header file in the project workspace, why
> can I not include it?  Is there some sort of build option
> that I need to set to make sure it is in the search path?

> Any help appreciated.



Sun, 09 Oct 2005 21:22:14 GMT  
 "Cannot open include file"
Adding the files to the workspace does not make them findable by #include; it only makes
sure they are checked during dependency analysis. You still need to make the header file
visible. This is because that inclusion does not establish a path the the .h file for the
compiler.

Go to Project->Settings->C/C++ and add the path to "additional include directories".
That's the simplest method, although not always the most elegant. It is best if you can
use a relative path, that is, if the other project is a parent directory or subdirectory
of the project you are compiling. Alternatively, I tend to put such files in a \include
directory under my project directory and put it in the include path.
                                        joe

Quote:

>I'm new to VC++ and am in the process of creating a Win 32
>Static Library.

>I am using this library to encapsulate a class that I
>created in another project workspace.  I used
>the "Project|Add to Project|Files|filename" to add both
>the .cpp and the .h files to the workspace.  I can see
>them in the workspace.

>However, in order to use this class elsewhere in my new
>library, I need to #include the header file.  Heres the
>error:

>C:\My Documents\Backup\Backup3\VCC_Projects\Day16
>\ModArt.cpp(7) : fatal error C1083: Cannot open include
>file: 'Line.h': No such file or directory

>I can see the header file in the project workspace, why
>can I not include it?  Is there some sort of build option
>that I need to set to make sure it is in the search path?

>Any help appreciated.

Joseph M. Newcomer [MVP]

Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


Mon, 10 Oct 2005 02:57:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. newbie question - "Cannot open include file"

2. Why "cannot open file nafxcwd.lib"?

3. cannot open file "mfc42ud.lib"??

4. cannot open file "nafxcwd.lib"

5. cannot open file "nafxcwd.lib"

6. LNK1104: cannot open file "mfc42u.lib"

7. cannot open file "nafxcwd.lib"

8. cannot open file "nafxcw.lib"

9. Cannot open file "nafxcw.lib"

10. Why cannot open file "MFCCE1d.lib"

11. "Cannot save file" error message

12. "Cannot save file" error message

 

 
Powered by phpBB® Forum Software