从源中编译Assimp不会生成Libassimp文件

发布于 2025-02-10 15:43:03 字数 611 浏览 2 评论 0原文

因此,我使用X64_X86开发人员命令提示提示了Assimp库,并用CMAKE编辑了CMAKE,该提示符被认为是必需的。 (当我尝试使用常规控制台CMAKE时,错误的错误是找不到“ CL编译器”)。

一段时间后,它最终对以下命令进行了编译:

cmake CMakeLists.txt -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
cmake --build .

它构建了3个文件:

C static library zlibstaticd.lib
CXX shared library ..\bin\assimp-vc142-mtd.dll
CXX executable ..\bin\unit.exe

但是没有libassimp.a或libassimp..,因此我可以在mingw中链接。我尝试在自己的项目中与te dll链接:

-L\"{assimp root directory}/bin\"
-lassimp-vc142-mtd

它失败了“对`sassimp :: Importer :: Importer()的不确定引用()”

我该如何使LIB文件链接到相反?

So I compiled the assimp library with cmake using the x64_x86 developer command prompt that was said to be required. (When I tried using the regular console cmake did an error that it could not find 'the cl compiler').

After some time it finally compiled without errors with the following commands:

cmake CMakeLists.txt -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
cmake --build .

It built 3 files:

C static library zlibstaticd.lib
CXX shared library ..\bin\assimp-vc142-mtd.dll
CXX executable ..\bin\unit.exe

But there was no libassimp.a or libassimp.so that I can link against in MinGW. I tried just linking with te dll in my own project with:

-L\"{assimp root directory}/bin\"
-lassimp-vc142-mtd

and it failed with "undefined reference to `Assimp::Importer::Importer()"

How can i get the lib file to link against?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

潜移默化 2025-02-17 15:43:03

我安装了MSYS2,用MSYS替换了现有的MINGW安装,图书馆完美地安装了,现在一切正常。

我的错误是:

  1. 我正在用VS C ++工具包编译库,而我将项目用Mingw Make和G ++编译
  2. ,即使我以正确的方式编译了Assimp,版本5.2.4也找不到一些标题,5.2.3和一些较旧的版本成功地编译了一些单位测试(上帝知道原因)。似乎总是在Github上遇到一些未解决的问题。永远不要从源头编译库。

I installed MSYS2, replaced my existing MinGW installation with MSYS, libraries installed flawlessly and everything works now.

My mistake was that:

  1. I was compiling the library with VS C++ toolkit while I'm compiling my project with MInGW make and g++
  2. even after I compiled assimp the correct way, version 5.2.4 couldn't find some header, 5.2.3 and some older versions compiled successfully, but failed some unit tests (God knows why). Seemed to always hit some unresolved issue on GitHub. Never again compiling libraries from source.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文