-1

I have been trying to link the very useful AssImp-library in my OpenGl project in Eclipse (CDT)

I successfully installed the AssImp library by following the answer to this question:

Trouble building the Open Asset Import Library (Assimp)

I also successfully set up OpenGl in Eclipse(CDT) by following the answer to this question:

OpenGL and GLUT in Eclipse on OS X

Now when i try to build some code where the AssImp-lib is being used the following error appears:

ld: warning: in /usr/local/lib/libassimp.a, file was built for unsupported file format which is not the architecture being linked (i386)

I guess the library is built for the wrong architecture ... I tried filling in "i386"in the CMake's "CMAKE_OSX_ARCHITECTURES:" flag but this does not help in any way...


Ok I changed the architecture but it still gives some linking errors..

does anybody have the same errors ?

Undefined symbols: "_get_crc_table", referenced from: _unzOpenCurrentFile3 in libassimp.a(unzip.c.o) "inflateInit2", referenced from: Assimp::XGLImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(XGLLoader.cpp.o) Assimp::BlenderImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(BlenderLoader.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) _unzOpenCurrentFile3 in libassimp.a(unzip.c.o) "_inflateEnd", referenced from: Assimp::XGLImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(XGLLoader.cpp.o) Assimp::BlenderImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(BlenderLoader.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) _unzCloseCurrentFile in libassimp.a(unzip.c.o) "_inflateSetDictionary", referenced from: Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) "_inflate", referenced from: Assimp::XGLImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(XGLLoader.cpp.o) Assimp::BlenderImporter::InternReadFile(std::basic_string, std::allocator > const&, aiScene*, Assimp::IOSystem*)in libassimp.a(BlenderLoader.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) _unzReadCurrentFile in libassimp.a(unzip.c.o) "_crc32", referenced from: _unzReadCurrentFile in libassimp.a(unzip.c.o) _unzReadCurrentFile in libassimp.a(unzip.c.o) "_inflateReset", referenced from: Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) Assimp::XFileParser::XFileParser(std::vector > const&)in libassimp.a(XFileParser.cpp.o) ld: symbol(s) not found

2
  • Sounds like a rather round-about way for Clang (presumably on OS X) to complain that assimp is x86_64. Change your build architecture to x86_64 and this should go away. Commented Dec 28, 2013 at 20:37
  • thank u for your answer! , but could u please be more specific ? I changed the C/C++ Build -> Settings -> Linker -> Miscellaneous linker flag to -arch x86_64 but this didn't work. thanx Commented Dec 30, 2013 at 10:55

1 Answer 1

0

I fixed the problem by adding the zlib library in the linker libraries -> add "z"

as suggested by gabor papp in the assimp-mailinglist

Not the answer you're looking for? Browse other questions tagged or ask your own question.