【问题标题】:How do files get into the External Dependencies in Visual Studio C++?文件如何进入 Visual Studio C++ 中的外部依赖项?
【发布时间】:2011-10-09 19:56:24
【问题描述】:

我想知道为什么我的一个项目在“外部依赖项”下列出了 VDSERR.h 而另一个没有,并且给我一个关于其中定义的符号的“未定义符号”编译器错误。如何将此文件也包含在其他项目中?

【问题讨论】:

    标签: c++ visual-studio visual-c++ external-dependencies


    【解决方案1】:

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

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

    【讨论】:

    • 只需右键单击您的项目并选择属性。在那里,您将在“配置属性”下获得另一组选项。转到 C/C++ 并在 -> General -> Additional Include Directories 下(其中所有第三方的头文件都在那里)。并在链接器 -> Additional Library Directories 下选择第三方库。
    • @siddhusingh 使用链接器文件夹上的 DLL 没有被复制到主项目的 bin 中。我该怎么办?
    • 对于 VS 2019,请参见此处docs.microsoft.com/en-us/cpp/build/reference/…
    【解决方案2】:
    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".
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-11
      • 2014-08-06
      • 2016-11-14
      • 1970-01-01
      • 1970-01-01
      • 2011-11-22
      • 2016-11-22
      • 2023-04-11
      相关资源
      最近更新 更多