assimp import failing on Xcode

时光毁灭记忆、已成空白 提交于 2019-12-11 17:56:12

问题


What I'm trying to do

... to import assimp, specifically:

#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

and some other assimp headers.

I'm using xcode 10.2.1.

The errors im getting:

What I tried

  • I imported assimp in Link Binary With Libraries, which was installed with brew install assimp

  • I reinstalled assimp with brew reinstall assimp, just in case.

Nothing has changed. Xcode still can't resolve the dependency.

I tried deleting the import the error is pointing on, but it just showed up at the next assimp import again, as in, xcode can't resolve the import, even though I added libassimp4.1.0.dylib from /usr/local/Cellar/assimp/4.1.0/lib. I'm lost here. This is supposed to work, but it doesn't. I imported other libs this way and never had an issue.


回答1:


I fixed it and this is how:

I fixed the compiler error by pointing xcode to the headers. It somehow didn't work with the homebrew installation, so I added this manually.

In your App settings, go to: build settings

scroll down to: search paths

there, find: header search paths

double click on it, then add by clicking +

add: /usr/local/Cellar/assimp/4.1.0/include as non-recursive

Disclaimer:

Depending on how you installed it or if or if not you installed Homebrew systemwide, which is not recommended, assimp might live in a different directory. In my case it was /usr/local/Cellar/



来源:https://stackoverflow.com/questions/56613212/assimp-import-failing-on-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!