简体   繁体   中英

Using header files with multiple projects in same solution

I'm using C++ and visual studio 2015. I've created 2 projects in 1 solution. The first project is a static library and the other a DLL. I want to include one header file from the static library to use it in the DLL. I tried specifying the path to the header file with - Project->Properties->C/C++ -> General -> Additional include directories but it doesn't work. When I try to include the header file I get a red underline saying "cannot open source file "SomeHeaderFile.h".

Thanks for the help.

Thanks for the tips but I found out how to make it work. The DLL is in a extra folder. All I had to do was #include "../../TheHeaderFileThatISpentHoursTryingToGet.h". I deleted the reference in the additional include directories path and it still works. I always thought that it made sense for files from different projects in the same solution to be accessible throughout all the projects. Thanks again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM