Visual Studio 2005 C ++ project dependency issues

I am working on a dataManagement project that periodically deletes files in a specific folder. The solution has three projects, one of which is an application, and the other two are static libraries. Now I want to add another project, which is the static library used for logging. The static logging library project has a header file to which the application project belongs. When I create a solution, I get an error because the header file was not found. When I added the static logging library project, I also made the application project dependent on it by checking the corresponding fix in the project dependencies. Can anyone help me out?

+4
source share
2 answers

He needs an extra file path to refer to the header file directory ...

Project-> Properties-> Config Properties-> C / C ++ β†’ Additional directories with addition

it does not automatically select the paths to the header file, it just knows how to link to the project ... Its completely undefined where the header should be. or even if you have a header file, you can forward the link to the item in another project if you want!

+4
source

There are two things you need to do in order to get a statically linked library running in VS. The compiler should be able to find the declaration for the characters you are referencing, and the linker should be able to resolve the full definition. When you add the .lib file to the VS project, this meets the second obligation. To meet the first, you must include the header somewhere in the source hierarchy before the first link, and you must also tell the project where to find the header files. Dependency settings in VS establish only the build order - here they will not help. You must make sure that the folder in which your header files are located is added to the "Include Additional Directories" in the project properties or is one of the global include directories in the main VS options. You must also ensure that .lib is added to the Additional Dependencies linker setting.

+1
source

All Articles