🔒 Locked
Boost
Advertisement
Original Post
Quote:
Original post by Jedimace
I have my game engine I am working on, and I would like to have Boost as part of the project, so I want the Boost stuff to compile with the engine. I was trying to put the source into my project, but it couldn't find all of the .ipp files. Where and what are these?
For most Boost libraries, you can just add all the .cpp files to your project, and it should compile. The .ipp files are #included as necessary.
However, the normal approach is to compile Boost separately and link to the generated libraries.
Quote:
Although, I will find a way to put it in my class without having to download it separately as a user of my game engine.
Huh?
If you use the dynamically linked version of Boost, you just have to bundle a couple of .dll's with your game. If you use the statically linked version, you don't have to distribute anything, other than the game itself.
You don't need to compile Boost as part of your project for that. Compile it separately, once, using bjam as explained on http://www.boost.org. Then just link to the libraries you want.
If you copy the .h .cpp files into your project folder then add those files to your project Visual Studio will compile them into your exe. This one way of doing static linking. It's called static since you can't change the version of boost you are using without recompiling. Boost just becomes another bit of code in your project.
edit: missed the bit about using code blocks. Effectively the same, just add the required boost files into your project; Don't add the whole thing it'll blow out your executable big time.
edit: missed the bit about using code blocks. Effectively the same, just add the required boost files into your project; Don't add the whole thing it'll blow out your executable big time.
You include Boost in exactly the same way you'd include any other library.
First, you compile the library (unless you can download a precompiled version).
This gives you some .dll files and/or some .libs.
In your code, you #include the relevant header files from the library, and you then set the linker options to link to the relevant .lib file from the library.
The .lib file will get linked into your file, so you don't need to distribute that with your game. If it calls out into a .dll, that dll will have to be distributed.
Boost enables both variants. All the libboost*.lib files are for the .lib-only versions of the libraries, and the boost*.lib files are simple stubs which take care of loading the relevant .dll and calling into that. So link to the version you need, and if you choose the dll version, bundle the dll's with your application.
Note that there's nothing Boost specific in this. It's how you'd link to any library.
[Edited by - Spoonbender on October 21, 2008 3:39:35 PM]
First, you compile the library (unless you can download a precompiled version).
This gives you some .dll files and/or some .libs.
In your code, you #include the relevant header files from the library, and you then set the linker options to link to the relevant .lib file from the library.
The .lib file will get linked into your file, so you don't need to distribute that with your game. If it calls out into a .dll, that dll will have to be distributed.
Boost enables both variants. All the libboost*.lib files are for the .lib-only versions of the libraries, and the boost*.lib files are simple stubs which take care of loading the relevant .dll and calling into that. So link to the version you need, and if you choose the dll version, bundle the dll's with your application.
Note that there's nothing Boost specific in this. It's how you'd link to any library.
[Edited by - Spoonbender on October 21, 2008 3:39:35 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement