麻烦构建开放式资产导入库(Assimp) [英] Trouble building the Open Asset Import Library (Assimp)

查看:150
本文介绍了麻烦构建开放式资产导入库(Assimp)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚下载的开放资源导入库(Assimp),这是用于导入3D文件格式,如.3DS和.OBJ成源$ C ​​$ C的API。这样做允许使用openGL的网格很容易渲染。

I have just downloaded the Open Asset Import Library (Assimp) which is an API used to import 3D file formats such as .3DS and .Obj into source code. Doing so allows for much easier rendering of meshes using openGL.

问题是,我不能让图书馆建设。它配备了如何建立并连接到一个编译器非常模糊,神秘的方向,如X code(这我使用)。它说我应该使用一个名为CMake的建库方案。我已经下载CMake的,并试图使用它,但还没有为我工作。

The problem is, I can't get the Library to build. It comes with very vague and cryptic directions on how to build it and connect to a compiler such as XCode (which I am using). It says I should use a program called CMake to build the library. I have downloaded CMake and tried to use it but it has not yet worked for me.

在这里没有人成功建造和安装使用CMake的或一些其他工具Assimp?

Has anyone here successfully built and installed Assimp using CMake or some other tool?

推荐答案

我完全同意为Mac的文档是有点欠缺,但我已成功(经过几次尝试)来构建和安装库。

I totally agree that the documentation for Mac is a bit lacking, but I have managed (after several attempts) to build and install the library.

开始之前,有几件事情:确保你已经安装了X code命令行工具(即安装GNU编译器)。
这是我遵循的步骤:

A few things before starting: make sure you have installed XCode Command Line Tools (that installs the GNU compiler). These are the steps I followed:


  1. 下载Assimp的最新版本,并提取它(我得到的文件
    从这里开始,一个与源只:
    <一href=\"http://sourceforge.net/projects/assimp/files/assimp-3.0/\">http://sourceforge.net/projects/assimp/files/assimp-3.0/)

  2. 如果你没有的话,安装CMake(<一个href=\"http://www.cmake.org/cmake/resources/software.html\">http://www.cmake.org/cmake/resources/software.html;我目前使用的是旧版本,但最新一期应罚款以及)

  3. 创建一个build目录(应该是源目录之外)

  4. 开启CMake的,它指向你在步骤1中创建的文件夹(在那里说:哪里是源头code);其他的文件夹(在哪里建二进制文件)应指向在第3步
  5. 创建的文件夹
  6. 单击配置的底部;它会问你,你想使用的环境。我拿起Eclipse CDT的4 - Unix的Makefile文件

  7. 您应该得到一个选项列表;我选择了两个人BUILD_STATIC_LIB和ENABLE_BOOST_WORKAROUND

  8. 单击生成

  9. 现在,你应该将到终端,然后转到第3步
  10. 创建的文件夹
  11. 输入make,并启动它;你应该看到构建无进展的问题

  12. 在当前构建完成后,键入须藤使安装;它会询问您的密码,并安装库

  1. Download the latest release of Assimp and extract it (I got the file from here, the one with source only: http://sourceforge.net/projects/assimp/files/assimp-3.0/)
  2. If you don't have it, install CMake (http://www.cmake.org/cmake/resources/software.html; I'm currently using an older version, but the latest one should work fine as well)
  3. Create a build directory (should be outside the source directory)
  4. Open CMake and point it to the folder you created at step 1 (where it says "Where is the source code"); the other folder ("Where to build the binaries") should point to the folder created at step 3
  5. Click "Configure" on the bottom; it will ask you which environment you'd like to use. I picked "Eclipse CDT 4 - Unix Makefiles"
  6. You should get a list of options; the two I selected were "BUILD_STATIC_LIB" and "ENABLE_BOOST_WORKAROUND"
  7. Click "Generate"
  8. Now you should move to the terminal and go to the folder created at step 3
  9. Type "make" and launch it; you should see the build progressing without issues
  10. When the build is finished, type "sudo make install"; it will ask for your password and install the library

最后一步后,你应该能够在您的code库:

After the last step you should be able to include the library in your code:

#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

请确保您还包括用于链接库;链接时,你应该-lassimp添加到列表中。

Make sure you also include the library for linking; when linking you should add -lassimp to the list

让我知道如果你有以上!步骤的任何问题。

Let me know if you have any issues with the steps above!

这篇关于麻烦构建开放式资产导入库(Assimp)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆