gpt4 book ai didi

c++ - 使用 xbuild 编译 Visual C++ 项目时定义目标

转载 作者:搜寻专家 更新时间:2023-10-31 01:53:28 25 4
gpt4 key购买 nike

我有一个输出库的 Visual C++ 项目,我想使用 xmake 在 Linux 上构建它。我可以在 monodevelop 中构建它,但我希望能够从命令行构建它。

如果我尝试使用“xbuild”调用构建项目,则会收到以下错误:

....ItemMinerLibMono.cproj: error : Target named 'Build' not found in the project.

我从文档中了解到我需要在 csproj 文件中添加一个名为“Build”的目标,但我不知道该怎么做。我尝试像这样导入 Microsoft.Common.targets 文件:

<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />

但是我得到了错误:

: error : Target 'CreateManifestResourceNames', a dependency of target 'PrepareResources', not found.

有人知道如何从命令行成功编译 C++ 项目吗?

谢谢,格雷戈尔

最佳答案

将以下内容添加到 MonoDevelop 的 .cproj 文件中,它将使用 xbuild 构建。

<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/>

可能有更简单的解决方案,但到目前为止我还没有想出一个。

关于c++ - 使用 xbuild 编译 Visual C++ 项目时定义目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11134766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com