🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Trouble setting up Assimp

Started by
11 comments, last by TheStudent111 9 years ago

Hello, I'm new to this library and I'm not sure what I'm doing wrong.

I have Visual Studio 2012 Express

Windows 8.1 64 bit

So far, I went to the Assimp homepage and downloaded assimp--3.0.1270-full.zip and placed in in my folders. Then I

placed the Assimp32d.ll from bin\assimp_debug-dll_win32 to my Debug folder were I keep my other dlls to run the executable.

Then to my project settings I did the following in Visual Studio:

Configuration: All Configuration

C\C++ -> General -> Additional Include directories: C:\assimp--3.0.1270-sdk\include;

Configuration: Debug

Linker-> General -> Additional Library directories: C:\assimp--3.0.1270-sdk\lib\assimp_debug-dll_win32

Linker -> Input -> Additional Dependencies: Assimp32d.lib;

Then I use the following code:


#include <assimp\Importer.hpp>

#include <assimp\scene.h>

#include <assimp\postprocess.h>

#include <string>



using std::string;



bool LoadModel(const string & file)

{

    Assimp::Importer importer;



    const aiScene * scene = importer.ReadFile(file, aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType);



    if(!scene)

    {

        LoadModel(importer.GetErrorString());

        return false;

    }





    return true;



}
 

Run, then get this error:

Error 1 error LNK1104: cannot open file 'Assimp32d.lib'

I don't know what I'm doing wrong, can somebody lead me in the right direction. Thanks

Advertisement

Look inside .../assimp/lib/assimp_debug-dll_win32/...

At the step:

"Linker -> Input -> Additional Dependencies: Assimp32d.lib"

It should be:

"Linker -> Input -> Additional Dependencies: assimp.lib"

When you say look inside .../assimp/lib/assimp_debug-dll_win32/...

should I copy the assimp.lib in my executable folder or should I link it. Because I pasted it into my debug folder. Did you mean link it.

I changed it to "Linker -> Input -> Additional Dependencies: assimp.lib" like you said. The previous error is gone, but now I'm get the following error from a dialog box

"The application was unable to start correctly (0xc0150002). Click OK to close the application."

Yeah, I meant you should link it. I was just pointing at the folder because the file inside the folder was "assimp.lib" instead of "Assimp32d.lib".

Error is indicating that some dll is either wrong or missing. I think the pre-built binaries that comes with the zip file is for other versions of VC++.

Have you tried to build Assimp yourself? Or use other binaries of Assimp?

I did already link it

Configuration: Debug

Linker-> General -> Additional Library directories: C:\assimp--3.0.1270-sdk\lib\assimp_debug-dll_win32

Or did you mean somewhere else?

No I have not tried building it myself should I?

Originally, I tried assimp 3.1.1. I kept having problems with it, and I read somewhere that version 3.1.1 had a lot of bugs, so it was recommended that I switch to an older version.

The one I'm using right now is assimp--3.0.1270-full.zip from the site.

What other binaries do you recommend?

What are the advantages of building it myself? (I'm assuming CMake would be needed).

The prebuilt binaries in this particular zip file (assimp--3.0.1270-full.zip) are built with VC++ 2008. Therefore you need the VC++ 2008 Redistributable Package.

Another problem is with Assimp32d.dll and assimp.lib in the /assimp/lib/assimp_debug-dll_win32/ folder when you compile your program in debug mode. Even though you are in debug mode try to link to the release versions of Assimp. Link to the assimp.lib in /assimp/lib/assimp_release-dll_win32/ and copy Assimp32.dll into your output file.

Since you have Visual Studio 2012 already get the binaries from here (assimp-3.1.1-win-binaries.zip). They are built with VC++110 (VS 2012). So you don't need the VC++ 2008 Redistributable Package.

In this version (3.1.1) there aren't even debug binaries, so just link everything, regardless of debug or release mode, to assimp.lib in lib32 or lib64 folder and copy the assimp.dll in bin32 or bin64 to your output folder.

A small caveat: When I tried to built in debug mode I had to copy assimp.exe from the bin folder to my output folder too. In release mode this wasn't required.

UPDATE:

I didn't see your reply when I posted this. So if you really need to use the prebuilt binaries of 3.0.1270 then you should install the the VC++ 2008 Redistributable Package first and just link everything to the release libs and use the release dll. I tried it out just now and it worked for me.

I did what you said and downloaded assimp-3.1.1-win-binaries.zip.

When I used the lib32. I got the same error:


  "The application was unable to start correctly (0xc0150002). Click OK to close the application."

Here were my settings

Configuration: All Configuration

C/C++ -> General -> Additional Include Directories: C:\assimp-3.1.1-win-binaries\include;

Linker -> General -> Additional Library Directories: C:\assimp-3.1.1-win-binaries\lib32;

Configuration: Debug

Linker -> Input -> Additional Dependencies: assimp.lib;

Configuration: Release

Linker -> Input -> Additional Dependencies: assimp.lib;

I placed the following from bin32: assimp.lib, assimp.exe, and assimp_viewer.exe in the Debug folder were i keep all my other dlls.

When I used the lib64, with bin64, I get the following errors


Error    6    error LNK1120: 4 unresolved externals   
 
Error    3    error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::~Importer(void)" (??1Importer@Assimp@@QAE@XZ) referenced in function "bool __cdecl LoadModel(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadModel@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  

Error    2    error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::Importer(void)" (??0Importer@Assimp@@QAE@XZ) referenced in function "bool __cdecl LoadModel(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadModel@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   
 
Error    5    error LNK2019: unresolved external symbol "public: char const * __thiscall Assimp::Importer::GetErrorString(void)const " (?GetErrorString@Importer@Assimp@@QBEPBDXZ) referenced in function "bool __cdecl LoadModel(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadModel@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)  

Error    4    error LNK2019: unresolved external symbol "public: struct aiScene const * __thiscall Assimp::Importer::ReadFile(char const *,unsigned int)" (?ReadFile@Importer@Assimp@@QAEPBUaiScene@@PBDI@Z) referenced in function "public: struct aiScene const * __thiscall Assimp::Importer::ReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?ReadFile@Importer@Assimp@@QAEPBUaiScene@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z) 
 

The settings:

Configuration: All Configuration

C/C++ -> General -> Additional Include Directories: C:\assimp-3.1.1-win-binaries\include;

Linker -> General -> Additional Library Directories: C:\assimp-3.1.1-win-binaries\lib64;

Configuration: Debug

Linker -> Input -> Additional Dependencies: assimp.lib;

Configuration: Release

Linker -> Input -> Additional Dependencies: assimp.lib;

Used the following from bin64. assimp.lib, assimp.exe, and assimp_viewer.exe and placed them in the debug folder with my other dlls.

I really don't understand what I'm doing wrong. Sorry for not getting it, you've been a huge help. JayPhi

...

I placed the following from bin32: assimp.lib, assimp.exe, and assimp_viewer.exe in the Debug folder were i keep all my other dlls.

...

Used the following from bin64. assimp.lib, assimp.exe, and assimp_viewer.exe and placed them in the debug folder with my other dlls.

...

It should be assimp.dll (!) (In \assimp-3.1.1-win-binaries\bin32 and \assimp-3.1.1-win-binaries\bin64 folder there should be the files assimp.dll, assimp.exe, assimp_viewer.exe)

Was it just a typo or did you really put assimp.lib inside your output folder? Besides that, everything looks fine.

Yes it was a typo. I placed the assimp.dll in the output folder. I wrote assimp.lib in the Linker->Input-> Additional Dependencies.

At this point I think it would have been easier if you had built it yourself, which is fairly easy with CMake. :-)

But if you want to give it a try here is my built of Assimp 3.1.1 with VS Express 2012 for x86 and x64: assimp.zip

1. Unzip to e.g. C:\

2. Open VS Express 2012

3. Open existing project

4. Build -> Clean Solution

5. For x86 built:

- Check Configuration is on: Debug/Release and Win32

- C/C++ -> General -> Additional Include Directories: C:\assimp-3.1.1_x86_VS2012\include;

- Linker -> General -> Additional Library Directories: C:\assimp-3.1.1_x86_VS2012\lib;

- Linker -> Input -> Additional Dependencies: assimp.lib;

5. For x64 built:

- Check Configuration is on: Debug/Release and x64

- C/C++ -> General -> Additional Include Directories: C:\assimp-3.1.1_x64_VS2012\include;

- Linker -> General -> Additional Library Directories: C:\assimp-3.1.1_x64_VS2012\lib;

- Linker -> Input -> Additional Dependencies: assimp.lib;

6. Build -> Build Solution

7. Copy assimp.dll from C:\assimp-3.1.1_x86_VS2012\bin or C:\assimp-3.1.1_x64_VS2012\bin to your Debug/Release-Output-Folder next to .exe file

8. Debug -> Start Debugging (F5)

There should be no errors, warnings or whatsoever, but if there is, you should try to build Assimp with CMake yourself.

This topic is closed to new replies.

Advertisement