【问题标题】:Building Assimp with CMake使用 CMake 构建 Assimp
【发布时间】:2015-04-09 06:08:16
【问题描述】:

我想在我的 Qt 应用程序(编译器:MSVC2013)中使用 assimp 库 (http://assimp.sourceforge.net/)。

我的问题是我不知道如何构建库。这是我尝试过的。

  1. 我下载了 assimp-3.1.1.zip 和 CMake。
  2. 跑CMake-gui
  3. 在“源代码在哪里”中选择 assimp-3.1.1.zip 的解压文件夹。
  4. 在“构建二进制文件的位置”中,我选择了一个名为“cmake binary/3.1.1”的新文件夹。
  5. 我选择了“配置”并选择了 Visual Studio 12 2013 Win64 和“使用默认本机编译器”。
  6. 我取消选中“BUILD_SHARED_LIBS”并选中“BUILD_STATIC_LIB”和“ENABLE_BOOST_WORKAROUND”
  7. 我点击“生成”。

一旦我用 Visual Studio 打开生成的“Assimp.sln”(我不确定它是否正确,因为我想在之后将它与 Qt 一起使用)并通过右键单击 -> 构建构建“ALL_BUILD”。这个可行,但现在问题来了:如果我构建“安装”,我会收到以下错误:

Error   20  error MSB3073: The command "setlocal
C:\Data-NoBackup\CMake\bin\cmake.exe -DBUILD_TYPE=Debug -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets  132 5   INSTALL"

谷歌搜索此错误后发现我必须以管理员身份运行我的程序(根据https://social.msdn.microsoft.com/Forums/vstudio/en-US/02d24b1e-65ff-4177-bdf2-0d1e0fb8cdf6/error-msb3073-and-my-build-exited-with-code-1)。

但这对我没有帮助。我仍然收到此错误。我希望你能在这里帮助我。提前致谢。

【问题讨论】:

  • 你试过不用安装就用吗?它在工作吗?配置和构建是否没有错误?

标签: cmake assimp


【解决方案1】:

我也遇到了这个问题,在这里发现和这个问题有关:

https://github.com/assimp/assimp/issues/500

cmake_install.cmake 文件似乎存在问题,找不到调试符号。

我发现通过禁用ASSIMP_INSTALL_PDB(通过-DASSIMP_INSTALL_PDB=FALSE)构建按预期工作。

【讨论】:

    猜你喜欢
    • 2021-09-24
    • 2019-01-11
    • 2021-04-15
    • 2021-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    相关资源
    最近更新 更多