Public Group

# Assimp Unresolved Externals

This topic is 2922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm working on a model loader with the Assimp library. I included the .lib and include files in my project properties->VC++ Directories and everything seemed to be fine. I started writing some code and when I got to the point that I could actually run it I ran into the following unresolved externals. Basically any time I try to create the actual importer it throws the errors. For example with only the following code and some Assimp variable types in the code (such as aiScene) I get the externals. When the importer is commented out they go away.

 Assimp::Importer importer; 

 1>MeshLoader.obj : error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::~Importer(void)" (??1Importer@Assimp@@QAE@XZ) referenced in function "public: struct ID3DX10Mesh * __thiscall MeshLoader::ImportMesh(struct ID3D10Device *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?ImportMesh@MeshLoader@@QAEPAUID3DX10Mesh@@PAUID3D10Device@@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>MeshLoader.obj : error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::Importer(void)" (??0Importer@Assimp@@QAE@XZ) referenced in function "public: struct ID3DX10Mesh * __thiscall MeshLoader::ImportMesh(struct ID3D10Device *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?ImportMesh@MeshLoader@@QAEPAUID3DX10Mesh@@PAUID3D10Device@@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

Below are the full steps that I've done, I'm pretty sure the library is added correctly so I'm not sure what the problem is.
1. I Built the Assimp library from scratch in Visual Studio 10. I just added all the included and source files to a project. Then went into project properties and changed the configuration type to static library
2. Built the project, everything went fine.
3. Made a folder inside my project directory called externals, added an include and lib folder, then copied the includes and lib into it.
4. Went to project properties->VC++ Directories->include directories and added externals\ASSIMP\include
5. Went to project properties->VC++ Directories->library directories and added externals\ASSIMP\lib
6.Started coding the loader, visual studio seemed to be set up properly, but when I ran the app I got those externals.

A few things I've tried - I'm using Windows 7 64-bit.
1. Rebuilt Assimp
2. Rebuild Assimp with \MACHINE:X64 in the librarian command line. (the result was it saying something like it found a x86 processor and x64 doesn't match). I can get the exact message if needed. I started playing with this because I was getting a warning that it wasn't defined. I ended up just sticking \MACHINE:X86 in the command line and the warning went away.
3. I've also tried some pre-built libs that came with ASSIMP but they were compiled in visual studio 2008 and produced the same results.
4. Commenting out everything in the code other than Assimp::Importer importer which produced unresolved externals.

I'm kinda confused on what to do now, anyone have some ideas?

##### Share on other sites
Did you actually add the .lib file to your project? This can be done in a couple ways. The one I usually use is going to the project properties and under Linker/Input, add the .lib file to the Additional Dependencies line.

##### Share on other sites

I'm working on a model loader with the Assimp library. I included the .lib and include files in my project properties->VC++ Directories and everything seemed to be fine. I started writing some code and when I got to the point that I could actually run it I ran into the following unresolved externals. Basically any time I try to create the actual importer it throws the errors. For example with only the following code and some Assimp variable types in the code (such as aiScene) I get the externals. When the importer is commented out they go away.

 Assimp::Importer importer; 

 1>MeshLoader.obj : error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::~Importer(void)" (??1Importer@Assimp@@QAE@XZ) referenced in function "public: struct ID3DX10Mesh * __thiscall MeshLoader::ImportMesh(struct ID3D10Device *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?ImportMesh@MeshLoader@@QAEPAUID3DX10Mesh@@PAUID3D10Device@@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>MeshLoader.obj : error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::Importer(void)" (??0Importer@Assimp@@QAE@XZ) referenced in function "public: struct ID3DX10Mesh * __thiscall MeshLoader::ImportMesh(struct ID3D10Device *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?ImportMesh@MeshLoader@@QAEPAUID3DX10Mesh@@PAUID3D10Device@@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

Below are the full steps that I've done, I'm pretty sure the library is added correctly so I'm not sure what the problem is.
1. I Built the Assimp library from scratch in Visual Studio 10. I just added all the included and source files to a project. Then went into project properties and changed the configuration type to static library
2. Built the project, everything went fine.
3. Made a folder inside my project directory called externals, added an include and lib folder, then copied the includes and lib into it.
4. Went to project properties->VC++ Directories->include directories and added externals\ASSIMP\include
5. Went to project properties->VC++ Directories->library directories and added externals\ASSIMP\lib
6.Started coding the loader, visual studio seemed to be set up properly, but when I ran the app I got those externals.

A few things I've tried - I'm using Windows 7 64-bit.
1. Rebuilt Assimp
2. Rebuild Assimp with \MACHINE:X64 in the librarian command line. (the result was it saying something like it found a x86 processor and x64 doesn't match). I can get the exact message if needed. I started playing with this because I was getting a warning that it wasn't defined. I ended up just sticking \MACHINE:X86 in the command line and the warning went away.
3. I've also tried some pre-built libs that came with ASSIMP but they were compiled in visual studio 2008 and produced the same results.
4. Commenting out everything in the code other than Assimp::Importer importer which produced unresolved externals.

I'm kinda confused on what to do now, anyone have some ideas?

Just to confirm, have you actually linked to the static lib that you have built, because I don't see that in your steps

##### Share on other sites

Adding ASSIMP\Lib to directories only tells VS where it can find external libraries, not which libraries to look for.

##### Share on other sites
It was indeed not linked, however once I linked it a lot more unresolved externals decided to show up

• 9
• 19
• 36
• 9
• 16