user12274423
user12274423

Reputation:

cannot build assimp with minGw64

I used cmake and I was able to build a C::B project. But Compiling the Assimp.cbp file raised a bunch of errors. Is there someone experimented in compiling assimp with mingw64 under w10 for C::B to send me clues ? Thks in advance. Here are the log errors :

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x8e): undefined reference to `Assimp::Importer::ValidateFlags(unsigned int) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0xc6): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x14e): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x191): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x1d0): undefined reference to `Assimp::Importer::GetErrorString() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x2b9): undefined reference to `Assimp::Exporter::Export(aiScene const*, char const*, char const*, unsigned int, Assimp::ExportProperties const*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x35c): undefined reference to `Assimp::Exporter::GetErrorString() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x426): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x435): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0xded): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x3b): undefined reference to `Assimp::DefaultLogger::create(char const*, Assimp::Logger::LogSeverity, unsigned int, Assimp::IOSystem*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x41): undefined reference to `Assimp::DefaultLogger::kill()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xb9): undefined reference to `Assimp::Importer::Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xce): undefined reference to `Assimp::Importer::SetPropertyInteger(char const*, int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0xe2): undefined reference to `Assimp::Exporter::Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x17b): undefined reference to `Assimp::Importer::IsExtensionSupported(char const*) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x1b5): undefined reference to `Assimp::Exporter::~Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x1bd): undefined reference to `Assimp::Importer::~Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x202): undefined reference to `aiGetCompileFlags'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x225): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x25e): undefined reference to `aiGetVersionMinor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x265): undefined reference to `aiGetVersionMajor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x2ed): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x2ff): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x379): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x39b): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x40c): undefined reference to `Assimp::Importer::GetExtensionList(aiString&) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x48b): undefined reference to `Assimp::Importer::ReadFile(char const*, unsigned int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x54d): undefined reference to `Assimp::Exporter::~Exporter()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text.startup+0x555): undefined reference to `Assimp::Importer::~Importer()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x2ed3): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x2ef6): undefined reference to `aiGetCompileFlags'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37a2): undefined reference to `aiGetVersionRevision'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37a9): undefined reference to `aiGetVersionMinor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(WriteDumb.cpp.obj):WriteDumb.cpp:(.text+0x37b0): undefined reference to `aiGetVersionMajor'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x22d2): undefined reference to `Assimp::Importer::GetMemoryRequirements(aiMemoryInfo&) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x2775): undefined reference to `aiGetMaterialString'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Info.cpp.obj):Info.cpp:(.text+0x288d): undefined reference to `aiGetMaterialString'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x1a): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x48): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x80): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x7ac): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x7e4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x80f): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0xabb): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0xaf4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x106c): undefined reference to `Assimp::Exporter::GetExportFormatCount() const'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0x10a4): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [tools\assimp_cmd\CMakeFiles\assimp_cmd.dir\build.make:177: tools/assimp_cmd/assimp.exe] Error 1
Le processus s'est terminé avec le code d'état 2 (8 minute(s), 52 seconde(s))
50 erreur(s), 113 avertissement(s) (8 minute(s), 52 seconde(s))

Upvotes: 0

Views: 986

Answers (3)

KimKulling
KimKulling

Reputation: 2833

As far as I know the tools are currently not working with this compiler. I need to check that.

Upvotes: 0

Brecht Sanders
Brecht Sanders

Reputation: 7287

Here's how I build it under MSYS2 with MinGW-w64:

tar xfz v5.0.0.tar.gz
cd assimp-5.0.0
# fix missing strcasecmp/strncasecmp in code/StringComparison.h (version >= 4.0.0)
mv code/StringComparison.h code/StringComparison.h.bak &&
sed -e "s/strcasecmp/stricmp/g; s/strncasecmp/strnicmp/g" code/StringComparison.h.bak > code/StringComparison.h
mkdir -p build_static build_shared &&
 cd build_static &&
 cmake.exe -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF -DASSIMP_HEADERCHECK:BOOL=OFF -DASSIMP_OPT_BUILD_PACKAGES:BOOL=OFF -DSYSTEM_IRRXML:BOOL=OFF -DASSIMP_BUILD_SAMPLES:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF .. &&
 cd .. &&
 cd build_shared &&
 cmake.exe -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DASSIMP_BUILD_TESTS:BOOL=OFF -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF -DASSIMP_HEADERCHECK:BOOL=OFF -DASSIMP_OPT_BUILD_PACKAGES:BOOL=OFF -DSYSTEM_IRRXML:BOOL=OFF -DASSIMP_BUILD_SAMPLES:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF .. &&
 cd .. &&
 # fix missing ../../revision.h
 cp -f build_shared/revision.h . &&
 make -Cbuild_static install/strip &&
 make -Cbuild_shared install/strip &&
 echo Success

Replace /usr/local with the destination folder that you need.

I was not successful building it with -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=ON though.

Upvotes: 1

Sergio
Sergio

Reputation: 931

I don't know assimp library, but if you use msys2, you can install the complete package (dynamic and static library and all the header files) with the command: pacman -S mingw-w64-x86_64-assimp.

Upvotes: 0

Related Questions