I've got a relatively simple setup in Visual Studio 2010- a main application and a DLL it depends on. I have a header that defines it's interface- how can I set up the header to be included in both projects? They are both in the same solution.
Asked
Active
Viewed 1,176 times
1
-
1Can't you just include it in the cpp-files where you need it? #include "MyHeader.h" – Christian May 29 '11 at 20:52
2 Answers
1
See my answer to this question, but its just that you are using a dynamic library.
In summary, the main application project should reference the DLL project for the purposes of linking, and the main project should include folder references so the compiler can access header files.
1
In the VC different projects are placed in a different subdirectories of the solution dir. If you want include files from the other project, you need to explicitly add it's dir to the include search path:
right click on the ".exe" project in the solution explorer. Choose properties. In the property window go to the "C/C++" section. There is the "Additional Include Directories" property. Add your "dll" project directory there.