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
I fixed the problem by adding the zlib library in the linker libraries -> add "z"
as suggested by gabor papp in the assimp-mailinglist