How to choose which library version to choose?

I have downloaded and built the Boost library, as according to these instructions: http://theseekersquill.wordpress.com/2010/08/24/howto-boost-mingw/ I need to use the serialization library, so I looked at the stage\lib folder, only to 16 different library files! Some are named mt, some sd, some s or d, and some a combination thereof, all this following libboost_serialization-mgw48. Some are dll files and some are a files. I tried using –lboost_serialization, as I have seen this mentioned on a lot of forums, but Eclipse says it can’t find that library. So how on Earth am I supposed to figure out which of the many files to link to?!

2013/10/9 Michael Kragh Pedersen
I have downloaded and built the Boost library, as according to these instructions:
http://theseekersquill.wordpress.com/2010/08/24/howto-boost-mingw/
I need to use the serialization library, so I looked at the stage\lib folder, only to 16 different library files! Some are named mt, some sd, some s or d, and some a combination thereof, all this following libboost_serialization-mgw48. Some are dll files and some are a files.
Those are different variants of the same library; you should choose one variant, and link to that variant only. -mt means multithreading -s means static (I think) -d means debug -sd probably means static debug
I tried using –lboost_serialization, as I have seen this mentioned on a lot of forums, but Eclipse says it can’t find that library. So how on Earth am I supposed to figure out which of the many files to link to?!
If you want the static single-threading non-debug version, you probably need something like -lboost_serialization-s-mgw48 -LX:\path\to\boost\libs HTH, Kris

Like Kris explained, these are the same libraries created for different use cases. I hope you know already, that a library in C++ can be linked statically to a project or loaded dynamically during runtime. Here http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html you can find an explanation of the different lib names see 6.3 Library Naming. If you wanna use a library in your application you have to specify the path where the compiler will look for libraries and you have to define which library you want to use. How and where you define these values depends on the IDE (Eclipse, Visual Studio, XCode) you are using. Usually there is something like Linker Flags where you define which library should be linked and Library Search Path where you specify where the compiler will look for additional libraries, at least in XCode. I link the boost libs statically to my projects, because otherwise the .dll files for the libs I used must be delivered together with the binary which I don't like so much. Cheers Georg 2013/10/9 Krzysztof Czainski <1czajnik@gmail.com>
2013/10/9 Michael Kragh Pedersen
I have downloaded and built the Boost library, as according to these instructions:
http://theseekersquill.wordpress.com/2010/08/24/howto-boost-mingw/
I need to use the serialization library, so I looked at the stage\lib folder, only to 16 different library files! Some are named mt, some sd, some s or d, and some a combination thereof, all this following libboost_serialization-mgw48. Some are dll files and some are a files.
Those are different variants of the same library; you should choose one variant, and link to that variant only.
-mt means multithreading -s means static (I think) -d means debug -sd probably means static debug
I tried using –lboost_serialization, as I have seen this mentioned on a lot of forums, but Eclipse says it can’t find that library. So how on Earth am I supposed to figure out which of the many files to link to?!
If you want the static single-threading non-debug version, you probably need something like -lboost_serialization-s-mgw48 -LX:\path\to\boost\libs
HTH, Kris
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Thank you, George and Krzysztof. The reason I asked about this is that I’m getting an error when trying to implement serialize into my class, and I thought this was due to the serialize template only being in one of the serialization libraries, thinking they all had different functions. The error I get is:
C:/boost_1_54_0/boost/serialization/access.hpp:118: undefined reference to `void boinc::work::Sudoku::serializeboost::archive::binary_oarchive(boost::archive::binary_oarchive&, unsigned int)'
Googling the error, I found this link:
http://stackoverflow.com/questions/9795888/boost-serialization-using-separat...
Which mentions putting the definition into the header, which I’ve tried, but I still get the same error. So given the following code, can anyone tell me what I’m doing wrong?
#ifndef SUDOKU_HPP_
#define SUDOKU_HPP_
#include

On Wed, Oct 9, 2013 at 11:31 AM, Michael Kragh Pedersen
Thank you, George and Krzysztof. The reason I asked about this is that I’m getting an error when trying to implement serialize into my class, and I thought this was due to the serialize template only being in one of the serialization libraries, thinking they all had different functions. The error I get is:
C:/boost_1_54_0/boost/serialization/access.hpp:118: undefined reference to `void boinc::work::Sudoku::serializeboost::archive::binary_oarchive(boost::archive::binary_oarchive&, unsigned int)'
Googling the error, I found this link:
http://stackoverflow.com/questions/9795888/boost-serialization-using-separat...
Which mentions putting the definition into the header, which I’ve tried, but I still get the same error. So given the following code, can anyone tell me what I’m doing wrong?
Here's a thought: in my experience integrating with facets of the boost library, dealt with Spirit Qi at some length, and Phoenix and so forth tend to want things navigable from the global (::) namespace, it can be sensitive to namespace issues. friend class boost::serialization::access may not be able to find ::boinc::Sudoku, for example. You might try non-intrusive serialization if that's an issue. Which is better SOLID style IMO anyway because it decouples the serialization know-how from the domain in the first place. Always a good thing; then the domain can update, the serialization could update, without either knowing the difference, necessarily.
#ifndef SUDOKU_HPP_ #define SUDOKU_HPP_
#include
#include namespace boinc { class Sudoku { friend class boost::serialization::access;
private: template<class Archive> void serialize(Archive &ar, const unsigned int version) { ... } }; } } #endif
I have been following the serialization tutorial here:
http://www.boost.org/doc/libs/1_54_0/libs/serialization/doc/tutorial.html
And I don’t see any difference between my code and the code in the documentation, besides the archive inclusions.
From: Krzysztof Czainski Sent: Wednesday, October 09, 2013 3:43 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] How to choose which library version to choose?
2013/10/9 Michael Kragh Pedersen
I have downloaded and built the Boost library, as according to these instructions:
http://theseekersquill.wordpress.com/2010/08/24/howto-boost-mingw/
I need to use the serialization library, so I looked at the stage\lib folder, only to 16 different library files! Some are named mt, some sd, some s or d, and some a combination thereof, all this following libboost_serialization-mgw48. Some are dll files and some are a files.
Those are different variants of the same library; you should choose one variant, and link to that variant only.
-mt means multithreading -s means static (I think) -d means debug -sd probably means static debug
I tried using –lboost_serialization, as I have seen this mentioned on a lot of forums, but Eclipse says it can’t find that library. So how on Earth am I supposed to figure out which of the many files to link to?!
If you want the static single-threading non-debug version, you probably need something like -lboost_serialization-s-mgw48 -LX:\path\to\boost\libs
HTH, Kris
________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Michael, I've thought about the non-intrusive way too, but I can't use that
as it doesn't work with private members from what I've understood. I did
however try to remove the namespace from my code, which works, but then
gives me the same error for forward_list and bitset, and from what I've read
in the documentation, the STL collections should already have serialize
methods within the boost library.
-----Original Message-----
From: Michael Powell
Sent: Wednesday, October 09, 2013 7:41 PM
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] How to choose which library version to choose?
On Wed, Oct 9, 2013 at 11:31 AM, Michael Kragh Pedersen
Thank you, George and Krzysztof. The reason I asked about this is that I’m getting an error when trying to implement serialize into my class, and I thought this was due to the serialize template only being in one of the serialization libraries, thinking they all had different functions. The error I get is:
C:/boost_1_54_0/boost/serialization/access.hpp:118: undefined reference to `void boinc::work::Sudoku::serializeboost::archive::binary_oarchive(boost::archive::binary_oarchive&, unsigned int)'
Googling the error, I found this link:
http://stackoverflow.com/questions/9795888/boost-serialization-using-separat...
Which mentions putting the definition into the header, which I’ve tried, but I still get the same error. So given the following code, can anyone tell me what I’m doing wrong?
Here's a thought: in my experience integrating with facets of the boost library, dealt with Spirit Qi at some length, and Phoenix and so forth tend to want things navigable from the global (::) namespace, it can be sensitive to namespace issues. friend class boost::serialization::access may not be able to find ::boinc::Sudoku, for example. You might try non-intrusive serialization if that's an issue. Which is better SOLID style IMO anyway because it decouples the serialization know-how from the domain in the first place. Always a good thing; then the domain can update, the serialization could update, without either knowing the difference, necessarily.
#ifndef SUDOKU_HPP_ #define SUDOKU_HPP_
#include
#include namespace boinc { class Sudoku { friend class boost::serialization::access;
private: template<class Archive> void serialize(Archive &ar, const unsigned int version) { ... } }; } } #endif
I have been following the serialization tutorial here:
http://www.boost.org/doc/libs/1_54_0/libs/serialization/doc/tutorial.html
And I don’t see any difference between my code and the code in the documentation, besides the archive inclusions.
From: Krzysztof Czainski Sent: Wednesday, October 09, 2013 3:43 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] How to choose which library version to choose?
2013/10/9 Michael Kragh Pedersen
I have downloaded and built the Boost library, as according to these instructions:
http://theseekersquill.wordpress.com/2010/08/24/howto-boost-mingw/
I need to use the serialization library, so I looked at the stage\lib folder, only to 16 different library files! Some are named mt, some sd, some s or d, and some a combination thereof, all this following libboost_serialization-mgw48. Some are dll files and some are a files.
Those are different variants of the same library; you should choose one variant, and link to that variant only.
-mt means multithreading -s means static (I think) -d means debug -sd probably means static debug
I tried using –lboost_serialization, as I have seen this mentioned on a lot of forums, but Eclipse says it can’t find that library. So how on Earth am I supposed to figure out which of the many files to link to?!
If you want the static single-threading non-debug version, you probably need something like -lboost_serialization-s-mgw48 -LX:\path\to\boost\libs
HTH, Kris
________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On 10/9/2013 5:54 PM, Michael Kragh Pedersen wrote:
Michael, I've thought about the non-intrusive way too, but I can't use that as it doesn't work with private members from what I've understood. I did however try to remove the namespace from my code, which works, but then gives me the same error for forward_list and bitset, and from what I've read in the documentation, the STL collections should already have serialize methods within the boost library.
-----Original Message----- From: Michael Powell Sent: Wednesday, October 09, 2013 7:41 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] How to choose which library version to choose?
On Wed, Oct 9, 2013 at 11:31 AM, Michael Kragh Pedersen
wrote: Thank you, George and Krzysztof. The reason I asked about this is that I’m getting an error when trying to implement serialize into my class, and I thought this was due to the serialize template only being in one of the serialization libraries, thinking they all had different functions. The error I get is:
C:/boost_1_54_0/boost/serialization/access.hpp:118: undefined reference to `void boinc::work::Sudoku::serializeboost::archive::binary_oarchive(boost::archive::binary_oarchive&,
unsigned int)'
Googling the error, I found this link:
http://stackoverflow.com/questions/9795888/boost-serialization-using-separat...
Which mentions putting the definition into the header, which I’ve tried, but I still get the same error. So given the following code, can anyone tell me what I’m doing wrong?
Here's a thought: in my experience integrating with facets of the boost library, dealt with Spirit Qi at some length, and Phoenix and so forth tend to want things navigable from the global (::) namespace, it can be sensitive to namespace issues. friend class boost::serialization::access may not be able to find ::boinc::Sudoku, for example.
You might try non-intrusive serialization if that's an issue. Which is better SOLID style IMO anyway because it decouples the serialization know-how from the domain in the first place. Always a good thing; then the domain can update, the serialization could update, without either knowing the difference, necessarily.
#ifndef SUDOKU_HPP_ #define SUDOKU_HPP_
#include
#include namespace boinc { class Sudoku { friend class boost::serialization::access;
private: template<class Archive> void serialize(Archive &ar, const unsigned int version) { ... } }; } } #endif
I have been following the serialization tutorial here:
http://www.boost.org/doc/libs/1_54_0/libs/serialization/doc/tutorial.html
You might repost this with [serialization] in the subject, you'll probably get more help. That said can you actually build the example code? Jeff
participants (5)
-
Georg Leidinger
-
Jeff Flinn
-
Krzysztof Czainski
-
Michael Kragh Pedersen
-
Michael Powell