Assimp: Unable to Link Against Assimp - Unresolved IIrrXMLReader

Created on 1 May 2018  路  5Comments  路  Source: assimp/assimp

So I built Assimp 4.1.0 as a static library and tried linking it with my project. Sadly, I receive this error:

Error   LNK2001 unresolved external symbol "class irr::io::IIrrXMLReader<char,class irr::io::IXMLBase> * __cdecl irr::io::createIrrXMLReader(class irr::io::IFileReadCallBack *)" (?createIrrXMLReader@io@irr@@YAPEAV?$IIrrXMLReader@DVIXMLBase@io@irr@@@12@PEAVIFileReadCallBack@12@@Z)

Error   LNK2019 unresolved external symbol "class irr::io::IIrrXMLReader<char,class irr::io::IXMLBase> * __cdecl irr::io::createIrrXMLReader(class irr::io::IFileReadCallBack *)" (?createIrrXMLReader@io@irr@@YAPEAV?$IIrrXMLReader@DVIXMLBase@io@irr@@@12@PEAVIFileReadCallBack@12@@Z) referenced in function "protected: virtual void __cdecl Assimp::IRRImporter::InternReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct aiScene *,class Assimp::IOSystem *)" (?InternReadFile@IRRImporter@Assimp@@MEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAUaiScene@@PEAVIOSystem@2@@Z)

This seems to maybe be related to #1283?

I'm building on Windows 10 with Visual Studio 2017 in Release mode. I'm not sure what additional information you might need, so here's the cmake configuration provided by the cmake GUI.

Commandline options:
-DASSIMP_BUILD_AC_IMPORTER:BOOL="0" -DASSIMP_BUILD_3D_IMPORTER:BOOL="0" -DASSIMP_PACKAGE_VERSION:STRING="0" -DILUT_LIBRARIES:FILEPATH="ILUT_LIBRARIES-NOTFOUND" -DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT:BOOL="0" -DASSIMP_BUILD_ZLIB:BOOL="1" -DASSIMP_BUILD_HMP_IMPORTER:BOOL="0" -DIL_LIBRARIES:FILEPATH="IL_LIBRARIES-NOTFOUND" -DASSIMP_BUILD_MD2_IMPORTER:BOOL="0" -DASSIMP_BUILD_XGL_IMPORTER:BOOL="0" -DCMAKE_CONFIGURATION_TYPES:STRING="Debug;Release;MinSizeRel;RelWithDebInfo" -DBUILD_TESTING:BOOL="1" -DASSIMP_BUILD_FBX_IMPORTER:BOOL="0" -DQt5Widgets_DIR:PATH="Qt5Widgets_DIR-NOTFOUND" -DASSIMP_BUILD_IFC_IMPORTER:BOOL="0" -DASSIMP_BUILD_AMF_IMPORTER:BOOL="0" -DCMAKE_BACKWARDS_COMPATIBILITY:STRING="2.4" -DASSIMP_BUILD_MD5_IMPORTER:BOOL="0" -DASSIMP_BUILD_NONFREE_C4D_IMPORTER:BOOL="0" -DASSIMP_BUILD_ASSXML_IMPORTER:BOOL="0" -DASSIMP_BUILD_Q3BSP_IMPORTER:BOOL="0" -DASSIMP_INSTALL_PDB:BOOL="0" -DASSIMP_BUILD_COB_IMPORTER:BOOL="0" -DASSIMP_LIB_INSTALL_DIR:STRING="lib" -DLIBRARY_OUTPUT_PATH:PATH="" -DASSIMP_BUILD_MMD_IMPORTER:BOOL="0" -DASSIMP_BUILD_X3D_IMPORTER:BOOL="0" -DASSIMP_BUILD_3DS_IMPORTER:BOOL="0" -DASSIMP_BUILD_IRRMESH_IMPORTER:BOOL="0" -DASSIMP_BUILD_X_IMPORTER:BOOL="0" -DASSIMP_ANDROID_JNIIOSYSTEM:BOOL="0" -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL="0" -DASSIMP_BUILD_COLLADA_IMPORTER:BOOL="1" -DASSIMP_BUILD_GLTF_IMPORTER:BOOL="0" -DASSIMP_BUILD_STL_IMPORTER:BOOL="0" -DILU_LIBRARIES:FILEPATH="ILU_LIBRARIES-NOTFOUND" -DASSIMP_BUILD_NDO_IMPORTER:BOOL="0" -DASSIMP_BUILD_RAW_IMPORTER:BOOL="0" -DBUILD_SHARED_LIBS:BOOL="0" -DASSIMP_BUILD_3MF_IMPORTER:BOOL="0" -DASSIMP_BIN_INSTALL_DIR:STRING="bin" -DASSIMP_BUILD_BLEND_IMPORTER:BOOL="0" -DASSIMP_BUILD_B3D_IMPORTER:BOOL="0" -DASSIMP_BUILD_ASE_IMPORTER:BOOL="0" -DEXECUTABLE_OUTPUT_PATH:PATH="" -DASSIMP_COVERALLS:BOOL="0" -DASSIMP_BUILD_SIB_IMPORTER:BOOL="0" -DCMAKE_DEBUG_POSTFIX:STRING="" -DASSIMP_BUILD_OFF_IMPORTER:BOOL="0" -DASSIMP_BUILD_IRR_IMPORTER:BOOL="1" -DASSIMP_BUILD_SMD_IMPORTER:BOOL="0" -DASSIMP_BUILD_OBJ_IMPORTER:BOOL="0" -DASSIMP_BUILD_OGRE_IMPORTER:BOOL="0" -DASSIMP_BUILD_Q3D_IMPORTER:BOOL="0" -DASSIMP_BUILD_OPENGEX_IMPORTER:BOOL="0" -DLIBRARY_SUFFIX:STRING="-vc140-mt" -DCMAKE_INSTALL_PREFIX:PATH="C:/Program Files/Assimp" -DIL_INCLUDE_DIR:PATH="IL_INCLUDE_DIR-NOTFOUND" -DASSIMP_BUILD_LWO_IMPORTER:BOOL="0" -DASSIMP_INCLUDE_INSTALL_DIR:STRING="include" -DSYSTEM_IRRXML:BOOL="0" -DASSIMP_BUILD_MD3_IMPORTER:BOOL="0" -DASSIMP_BUILD_LWS_IMPORTER:BOOL="0" -DASSIMP_BUILD_MS3D_IMPORTER:BOOL="0" -DASSIMP_BUILD_DXF_IMPORTER:BOOL="0" -DASSIMP_BUILD_PLY_IMPORTER:BOOL="0" -DASSIMP_BUILD_SAMPLES:BOOL="0" -DASSIMP_BUILD_ASSBIN_IMPORTER:BOOL="0" -DASSIMP_LIBRARY_SUFFIX:STRING="" -DASSIMP_BUILD_CSM_IMPORTER:BOOL="0" -DASSIMP_BUILD_MDL_IMPORTER:BOOL="0" -DASSIMP_BUILD_NFF_IMPORTER:BOOL="0" -DASSIMP_BUILD_TERRAGEN_IMPORTER:BOOL="0" -DASSIMP_BUILD_BVH_IMPORTER:BOOL="0" -DASSIMP_BUILD_MDC_IMPORTER:BOOL="0" -DASSIMP_BUILD_TESTS:BOOL="0" -DASSIMP_NO_EXPORT:BOOL="1" 

Am I missing something obvious?

Bug Build

Most helpful comment

You'll need IrrXML.lib and zlib.lib for static Assimp library. These two can be found in "contrib" folder of your generated project after build (Assimp 4.1.0), or you can declare your own if you already had them.

All 5 comments

I tried building again on a different computer with a new download of assimp and a new install of cmake on Visual Studio 2017 with the same cmake options and got the same link error. :(

I'm just a user, but I have noticed the more recent versions included this extra library which you need to statically link to. If you're not intending to use its features then you can probably leave it out in cmake.

Did you add IrrXML.lib to your dependencies before assimp-vc140-mt.lib?
Got a similar error because of that.

You'll need IrrXML.lib and zlib.lib for static Assimp library. These two can be found in "contrib" folder of your generated project after build (Assimp 4.1.0), or you can declare your own if you already had them.

Shall be fixed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

junjiaokou picture junjiaokou  路  4Comments

kimkulling picture kimkulling  路  4Comments

RichardTea picture RichardTea  路  5Comments

nickclark2016 picture nickclark2016  路  6Comments

NebuHiiEjamu picture NebuHiiEjamu  路  6Comments