【发布时间】:2011-10-09 19:56:24
【问题描述】:
我想知道为什么我的一个项目在“外部依赖项”下列出了 VDSERR.h 而另一个没有,并且给我一个关于其中定义的符号的“未定义符号”编译器错误。如何将此文件也包含在其他项目中?
【问题讨论】:
标签: c++ visual-studio visual-c++ external-dependencies
我想知道为什么我的一个项目在“外部依赖项”下列出了 VDSERR.h 而另一个没有,并且给我一个关于其中定义的符号的“未定义符号”编译器错误。如何将此文件也包含在其他项目中?
【问题讨论】:
标签: c++ visual-studio visual-c++ external-dependencies
External Dependencies 文件夹由 IntelliSense 填充:文件夹的内容根本不会影响构建(实际上您可以在 UI 中禁用该文件夹)。
您需要实际包含标题(使用#include 指令)才能使用它。根据该标头是什么,您可能还需要将其包含文件夹添加到“其他包含目录”属性中,并且您可能需要将其他库和库文件夹添加到链接器选项;您可以在项目属性中设置所有这些(右键单击项目,选择属性)。您应该将属性与构建的项目的属性进行比较,以确定您需要添加的内容。
【讨论】:
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".
【讨论】: