I am using boost in my project. I uploaded precompiled binaries here http://boost.teeks99.com/
When linking, I get this error:
Error 18 error LNK2005: "public: void __cdecl boost::thread::join(void)" ( ?join@thread @ boost@ @QEAAXXZ) already defined in boost_thread-vc110-mt-1_52.lib(boost_thread-vc110-mt-1_52.dll) C:\Oleg\projects\MBClient\FastNativeAdapter\libboost_thread-vc110-mt-1_52.lib(thread.obj) FastNativeAdapter
Why does boost contain two lib with such a similar name, what is the difference between them?
- libboost_thread-vc110-mt-1_52.lib
- boost_thread-vc110-mt-1_52.lib
How to fix a binding error?
upd I compiled myself. I added the boost_1_53_0\stage\lib directory to the linker. This directory actually contains 3 "copies" of each file, for example:
- boost_atomic-vc110-mt-1_53.dll
- boost_atomic-vc110-mt-1_53.lib
- libboost_atomic-vc110-mt-1_53.lib
So thatβs clear what the compiler is saying. Somehow, he cannot figure out which version of the lib file to use. This is probably due to static / dynamic linking, but I still can't find a solution. I am sure that my problems are quite common, so I hope someone can suggest me what to do.
I tried to delete all the "libboost *" files from the folder, but then I get the following error: Error 15 error LNK1104: cannot open file 'libboost_date_time-vc110-mt-1_53.lib'
I tried to delete all the "boost * lib" files from the folder, but then I get the following error: Error 15 error LNK1104: cannot open file 'boost_thread-vc110-mt-1_53.lib'
Then I copied boost_thread-vc110-mt-1_53.lib back and I get a lot of errors:
Error 16 error LNK2005: "public: virtual __cdecl boost::detail::thread_data_base::~thread_data_base(void)" ( ??1thread_data_base@detail @ boost@ @ UEAA@XZ ) already defined in boost_thread-vc110-mt-1_53.lib(boost_thread-vc110-mt-1_53.dll)
Therefore, when there is no boost_thread-vc110-mt-1_53.lib compiler claiming to be absent, when there is boost_thread-vc110-mt-1_53.lib compiler claims that "the function is already defined". Tried it, somehow I use dynamic and static binding at the same time or something like that?
upd2 I uncommented #define BOOST_ALL_DYN_LINK , as suggested here , and now the code compiles! I am investigating whether everything is in order. however, I did not understand why I should uncomment #define BOOST_ALL_DYN_LINK , so comments are welcome.