Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Compile Assimp on Windows with MinGW


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 aliasc   Members   -  Reputation: 180

Like
2Likes
Like

Posted 01 February 2014 - 12:07 PM

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.



Sponsor:

#2 dejaime   Crossbones+   -  Reputation: 4119

Like
0Likes
Like

Posted 01 February 2014 - 12:20 PM

If you want to use a notepad to program, you'll have to link everything yourself with your compiler.

Are you using CMake?



#3 aliasc   Members   -  Reputation: 180

Like
2Likes
Like

Posted 01 February 2014 - 12:26 PM

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 ?



#4 dejaime   Crossbones+   -  Reputation: 4119

Like
1Likes
Like

Posted 01 February 2014 - 02:02 PM

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, 01 February 2014 - 03:36 PM.


#5 arka80   Members   -  Reputation: 1056

Like
1Likes
Like

Posted 01 February 2014 - 03:00 PM

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



#6 dejaime   Crossbones+   -  Reputation: 4119

Like
5Likes
Like

Posted 01 February 2014 - 03:08 PM

Turns out the assimp library is not dependent on DirectX, but its tools are.
This is weird, since it means it is not portable. The library is, but its tools aren't. That makes absolutely no sense to me.
 

Why there are no precompiled libraries like SDL for example ?

I usually don't do this kind of thing but I'll provide you with a compiled copy for MinGW.
Notice that I am only doing this since assimp compile process asks for DirectX by default, what's really misleading. To be fair, their cmake solution overall is not the best I've seen. In addition, boost is trickier to build, there's no magic CMake files there...
 
I won't include its tools since I don't have DirectX installed, nor plan on installing. I only use OpenGL.
 
Precompiled binaries of assimp.
This was compiles using:

  • MinGW 4.8.1
  • CMake 2.8.12
  • Boost 1.55.0

under Win7 x64, MinGW 4.8.1.
 
Updated Download link - https://www.mediafire.com/?xuc3i12wxfsxe8k, as in this post.
 
Still, I highly recommend that you avoid precompiled binaries. Building libraries is important to know.
The process in this case would be:

  • Download Boost and decompress it somewhere (c:/boost, for example)
  • In the terminal run:
    • cd <boost directory path>
    • bootstrap.bat mingw
    • b2 --with-filesystem --with-system --with-regex --with-program_options variant=debug,release toolset=gcc link=shared -j 7
  • Now open CMake and insert your assimp root folder on the first text box (that reads Where is the code)
  • Select where you want to build the binaries, you may use the same as above or add a /build suffix, your choice (reads Where to build the binaries)
  • Press the Add Entry button, just under the above text boxes
  • Add a variable called BOOST_ROOT with the type Path and insert your boost directory in the value.
  • Hit the configure button (it will prompt a configuration warning in red, check the subitems).
    • If you want to build the assimp tools (and have the DirectX SDK installed) you may need to update the directx sdk directories.
    • If you do not want to build the tools, uncheck the option BUILD_ASSIMP_TOOLS
    • If you want the build to be a static version (no need for a dll), check the option BUILD_STATIC_LIB, if not leave it unchecked.
  • Hit the configure button again.
  • Hit generate.

Now you have prepared the files necessary to compile it. Now through the terminal just go to the folder (the path you inserted on Where to build the binaries) and issue the mingw32-make command.
 
As an output, you should have two files:

  •  
  • libassimp.dll (probably under the bin directory)
  • libassimp.dll.a (probably under the lib directory)

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


Edited by dejaime, 02 February 2014 - 09:52 PM.


#7 aliasc   Members   -  Reputation: 180

Like
0Likes
Like

Posted 01 February 2014 - 08:42 PM

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.



#8 dejaime   Crossbones+   -  Reputation: 4119

Like
1Likes
Like

Posted 01 February 2014 - 09:58 PM

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)



#9 fir   Members   -  Reputation: -456

Like
0Likes
Like

Posted 02 February 2014 - 03:40 AM

 

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 ??



#10 aliasc   Members   -  Reputation: 180

Like
0Likes
Like

Posted 02 February 2014 - 06:01 AM


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.



#11 dejaime   Crossbones+   -  Reputation: 4119

Like
2Likes
Like

Posted 02 February 2014 - 10:49 AM

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, 02 February 2014 - 12:51 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS