How to import assimp to my my Xcode project?

ぐ巨炮叔叔 提交于 2019-12-25 08:08:42

问题


I have downloaded assimp source code. How to import assimp to Xcode project - ARToolKit5 downloaded from ARToolkit official website? I am trying to load external models - made by blender,maya,3dmax - to this project. (ps: I am a beginner of Xcode, so please explain it in detail. ) Thank you! :)


回答1:


I know it's late, but it might benefit someone else.

Here are the steps :

  1. Download and extract the source code from(for version 3.3.1) https://github.com/assimp/assimp/archive/v3.3.1.zip

  2. Download CMake Gui, and select source as the folder you got after extracting above. Create a build folder inside the assimp folder, and select it to be the build directory.

  3. Select Configure and select XCode. Then Click on generate to generate build files in the build folder.

  4. Open Assimp.xcodeproj file in build folder in XCode and build it.

  5. Now you have got the library and include files. The library files are located in assimp(which you extracted)/build/code/Debug, and the include files are at two locations, one set is at assimp/include and other at assimp/build/include. Make a separate folders library and include at your desired location and copy all these files in the corresponding folders you created.

  6. Now open your project in XCode. Select your project from the left panel, and click on Build phases, click on + inside 'Link Binary with libraries', and click on add other, now select the libassimp.4.0.1.dylib(select the latest version) file.

  7. Now click on Build settings, inside search paths, add your include folder(which you created) to the header search paths, and the library folder to library search paths.

If you followed the steps correctly, you could use these statements inside your project

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


来源:https://stackoverflow.com/questions/41359551/how-to-import-assimp-to-my-my-xcode-project

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