【问题标题】:Nested static libraries in Visual Studio?Visual Studio 中的嵌套静态库?
【发布时间】:2017-08-15 22:57:16
【问题描述】:

我有一个用 C 语言实现 Vector 的静态库。

我现在正在制作一个新库,它将依赖Vector 来运行属性。这个新库被称为String。两者都是在 Visual Studio 中创建的静态库,具有自己的 .c.h 文件。

我会像引用任何其他静态库时一样执行以下操作

  • 创建新的静态库。在其中创建 .c.h 文件。

  • project -> properties -> C/C++ -> Additional include directories 并设置为包含我的Vector.c.h 文件的文件夹

  • File -> Add -> Existing Project,并设置Vector项目的.vcxproj文件。

  • 在我的解决方案资源管理器中,我进入我的String 解决方案并右键单击References,然后选中出现的Vector 框。

此时,我的String 现在可以正确看到Vector

问题

当我打开一个新项目时,重复这些相同的步骤,除了 String 作为目标库,我收到以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB8006 The Platform for project 'C-DataStructuresLib.vcxproj' is invalid.  Platform='HPD'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Platform.    CStringLib  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.InvalidPlatform.Targets    21

行:

如果其他项目试图遵循对此项目的项目到项目引用,此项目已被卸载或未包含在解决方案中,并且引用项目未使用相同构建,则也可能出现此错误或同等平台

是正确的,因为这正是我想要做的。如何解决这个问题?

【问题讨论】:

  • 很多谷歌点击了这个错误,水晶球说你有一台惠普桌面 (HPD) 机器。
  • Indeed so。介意向我提供您找到的任何信息的链接吗?我的 google fu 不错,但我没有在网上找到任何有用的东西
  • 只查询“platform hpd invalid”。
  • 很遗憾,我认为平台与此问题无关。
  • 尝试在 Visual Studio 中使用 CMake

标签: c visual-studio visual-studio-2015 static-libraries


【解决方案1】:

您是否尝试编译为 64 位项目?
检查属性页的部分:链接器 -> 高级 -> 目标机器

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-06
    • 2011-06-15
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    相关资源
    最近更新 更多