I've got a basic assimp example copied from the assimp site (with some minor modifications to make it work with C). Now the problem is that when it tries to link, assimp complains that it can't find ::operator delete(void*)
or std::allocator
or a lot of other C++ things. Assimp is supposed to work with a plain C interface, so it shouldn't be having this issue, right?
Another note: this is using statically linked assimp v3.3.1 compiled using the same MinGW-w64 compiler.
Here's my sample code which causes the errors:
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
int DoImport(const char* pFile){
const struct aiScene* s = aiImportFile(pFile,
aiProcess_CalcTangentSpace |
aiProcess_Triangulate |
aiProcess_JoinIdenticalVertices |
aiProcess_SortByPType);
if(!s)
return 0;
return 1;
}
int main(){}
And here are some examples of the errors:
C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/6.2.0/../../../../i686-w64-mingw32/lib/
../lib/libassimp.a(ImporterRegistry.cpp.obj):ImporterRegistry.cpp:(.text$_ZNSt6v
ectorIPN6Assimp12BaseImporterESaIS2_EE19_M_emplace_back_auxIJS2_EEEvDpOT_[__ZNSt
6vectorIPN6Assimp12BaseImporterESaIS2_EE19_M_emplace_back_auxIJS2_EEEvDpOT_]+0x71):
undefined reference to `operator delete(void*)'
C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/6.2.0/../../../../i686-w64-mingw32/lib/
../lib/libassimp.a(DefaultIOSystem.cpp.obj):DefaultIOSystem.cpp:(.text+0x818):
undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_M_create(unsigned int&, unsigned int)'