我想知道为什么我的一个项目VDSERR.h
列在“外部依赖项”下,而另一个没有,并给我一个关于在那里定义的符号的“未定义符号”编译器错误。如何将此文件也包含在其他项目中?
问问题
119659 次
2 回答
58
External Dependencies 文件夹由 IntelliSense 填充:文件夹的内容根本不影响构建(实际上您可以在 UI 中禁用该文件夹)。
您需要实际包含标题(使用#include
指令)才能使用它。根据该标头是什么,您可能还需要将其包含文件夹添加到“其他包含目录”属性中,并且您可能需要将其他库和库文件夹添加到链接器选项;您可以在项目属性中设置所有这些(右键单击项目,选择属性)。您应该将属性与构建的项目的属性进行比较,以确定您需要添加的内容。
于 2011-07-20T23:35:34.397 回答
5
To resolve external dependencies within project. below things are important..
1. The compiler should know that where are header '.h' files located in workspace.
2. The linker able to find all specified all '.lib' files & there names for current project.
So, Developer has to specify external dependencies for Project as below..
1. Select Project in Solution explorer.
2 . Project Properties -> Configuration Properties -> C/C++ -> General
specify all header files in "Additional Include Directories".
3. Project Properties -> Configuration Properties -> Linker -> General
specify relative path for all lib files in "Additional Library Directories".
于 2020-10-19T14:19:28.017 回答