• Advertisement
Sign in to follow this  

Compile Assimp on Windows with MinGW

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. Im new here and this will be my first post. Im struggling myself trying to build assimp on windows. I dont use Visual Studio. I work on Programmers Notepad with MinGW installed and i compile source files through command line with g++. Im learning OpenGL and SDL and i need assimp to import 3D scenes. But i cant get it to work. I downloaded the full package. I have searched through the internet and all they talk is about how to get it compiled under Visual Studio. I dont want to do that. I want to compile libraries under MinGW and use them as SDL for example.

 

If anyone wants to help please be more specific. I want to compile assimp on windows under MinGW.

Share this post


Link to post
Share on other sites
Advertisement

Im already doing that. Like g++ main.cpp -o text.exe -lmingw32 -lSDLmain -lSDL -lopengl32 -lglu32 and im fine with these. I just dont want to use Visual Studios compiler and i dont feel comfortable with CodeBlocks syntax highlighting. I just dont know how to get assimp libraries build. CMake gui complains about stuff like Directx SDK which i dont know why ? Should i download the SDK and try it again. Why there are no precompiled libraries like SDL for example ?

Share this post


Link to post
Share on other sites

You'd need to install (or link) all the dependencies of the library you are trying to build. But iirc the only dependency assimp has is boost, that is relatively trickier to set-up, and huge.

I don't recall DirectX being a dependency...

 

Usually, precompiled binaries are available for most libraries that are are under heavy use by beginners. If it is a complex library, it is assumed that whoever will use it will be able to build it using an automatic tool such as CMake or Premake4, given it is (usually) a simple process. This is due to the fact that on some cases there is no one size fits all build, and it makes it harder to provide precompiled versions.

 

The weird thing about assimp is that they provide prebuilt binaries for microsoft's compiler but not for MinGW...

Edited by dejaime

Share this post


Link to post
Share on other sites

Static lib for Visual Studio will work for MinGW as well, you can simply rename them from .lib to .a

 

I always do that and it works

Share this post


Link to post
Share on other sites

I usually don't do this kind of thing but I'll provide you with a compiled copy for MinGW.

 

I am a beginner. And i want to learn things and do some cool stuff with it.

So i hate it when i waste my time trying to put the wheels together just because someone else was just too lazy to do that. I would rather like to

get in and learn to drive. Thats the point. Anyway thank you very much for taking your time to help and providing me with the precompiled binaries.

Share this post


Link to post
Share on other sites

As I stated before, in C++ we have some situations where there isn't a "one size fits all" solution.

This one could have precompiled binaries, I agree. But "Putting the wheels together" is a part of what one should learn when using C++.

I'd consider this a part of the learning process and not a waste of time.

 

Still, I should mention that C++ has its advantages, but this is one of the many drawbacks. If this is really important to you, I'd recommend looking up C#, or other languages.

 

(PS: I accidentally downvoted you when I wanted to upvote, so I upvoted you twice to undo it)

Share this post


Link to post
Share on other sites

 

As an output, you should have two files:

  1. code / libassimp.dll
  2. code / libassimp.dll.a

This is for the shared build. I guess the static build would be code/libassimp.a, but I am guessing.

i could use it too (the same situation i got mingw, i am not learned to do such complex compiles, also limited internet connections to downloads <100MB )

 

but why is this so big? libassimp.dll 27MB, libassimp.dll.a 45 MB ??

Share this post


Link to post
Share on other sites


Still, I should mention that C++ has its advantages, but this is one of the many drawbacks. If this is really important to you, I'd recommend looking up C#, or other languages.

 

No i love C++. I love to be in low level. And with putting the wheels together i meant wasting my time trying to build those binaries and trying to link up things to work together. I would rather like to just learn assimp and its core. I know that linking up things with your project and making them work as whole is a thing that every programmer should know how to do it. But its just i was too frustrated. I will care about such details when i see myself good enough to handle big projects. I love C++ and im glad there are still people that contribute and extend our capabilities by developing libraries like assimp for example.

 

And i dont have any idea why those files are so big ? Maybe some paramethers, flags before compiling could help i dont know.

Share this post


Link to post
Share on other sites
I have no idea, didn't give much thought to it. Actually, I didn't even look at that size.
But through a quick google search I found this:
http://stackoverflow.com/questions/14805745/compiling-assimp-with-mingw
 
In other words, Assimp CMake really is a pita troublesome to configure, I got around 3 problems, and yet there's another.
If I use my windows for anything today I will recompile it without -g.
It is that big because -g creates debugging symbols. But I bet none of you will debug the library, nor most users will.
Now, why they left -g on by default under the release build is beyond me.
And there's also a build called minsize, that returns the exact same size as the default build...
No wonder assimp is so sparsely used.
 
Here is a download link for a smaller version of the library:
https://www.mediafire.com/?xuc3i12wxfsxe8k
This was the smallest I could come up with. I have also added the static lib. Edited by dejaime

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement