文件如何进入MSVC++ 2010中的外部依赖项?

Fel*_*bek 42 c++ external-dependencies visual-studio visual-c++

我想知道为什么我的一个项目的VDSERR.h列在"外部依赖项"下,另一个项目没有,并且给出了一个关于在那里定义的符号的"未定义符号"编译器错误.如何将此文件也包含在其他项目中?(可能是通过拖放,但我想知道这里的确切设置.)

Jam*_*lis 47

IntelliSense将填充External Dependencies文件夹:文件夹的内容根本不会影响构建(实际上您可以在UI中禁用该文件夹).

您需要实际包含标头(使用#include指令)才能使用它.根据标头的内容,您可能还需要将其包含的文件夹添加到"Additional Include Directories"属性中,您可能需要将其他库和库文件夹添加到链接器选项中; 您可以在项目属性中设置所有这些(右键单击项目,选择"属性").您应该将属性与构建的项目进行比较,以确定需要添加的内容.

  • 只需右键单击您的项目并选择属性即可.在那里,您将在"配置属性"下获得另一组选项.转到C/C++并在其下 - > General - > Additional Include Directories(其中包含第三方的所有头文件).并在链接器 - >附加库目录下选择第三方库. (8认同)
  • 抱歉,OP询问文件如何进入External Dependencies文件夹! (5认同)

Dat*_*ale 8

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".
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 在此输入图像描述