Visual C++ header file question...
Hi there, I have what I think is probably a pretty easy question, but I can''t find it in the help, and I can''t find an answer. I am using VC++ 5.0 with SP3 installed on Win2k. Okay, my problem is that I don''t know how to get my main.cpp file which is in .\projects\test to see a header file located in ..\..\Source Repository\classes\thread . Under FileView I right clicked on the files bit, and said "Add files to project" and selected the header file in the classes\thread directory. It added it, and I can open it via FileView now, and I added #include "threadBase.h" to main.cpp, but I get the error:
D:\Documents\Programming\Projects\test\main.cpp(4) : fatal error C1083: Cannot open include file: ''threadBase.h'': No such file or directory
If I physically move the .h file to the projedct\test directory, and update the FileView thing, everything compiles fine and dandy. However, I would like to keep my header files under classes\ (Becuase they are my reusable classes, which I want to use in multiple projects). How can I do this? Thanks.
I''m using VC++ 6, but there was something similar in VC++ 5. You can set the include directories, where VC will look for your header files. To do this go to ''Extras''->''Options''. Select the Directories tab. Just add the path where your include file is located. Also, change your include to
#include <threadBase.h>
That should work. Don''t know if the menu names are correct since my version of VC++ is in German.
Ciao,
MK42
#include <threadBase.h>
That should work. Don''t know if the menu names are correct since my version of VC++ is in German.
Ciao,
MK42
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement