2
votes

I am very new to boost. I needed to get the library files for one file thats used in an application that was made for me (so I can recompile the app myself).

I am able to make the boost library files, but a few of the files have an error and dont get made.

Here is the error copied from command prompt (note all I did to make the files was run ".\b2 link=shared")

Creating library bin.v2\libs\thread\build\msvc-11.0\release\threading-multi\b oost_thread-vc110-mt-1_54.lib and object bin.v2\libs\thread\build\msvc-11.0\rele ase\threading-multi\boost_thread-vc110-mt-1_54.exp thread.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) pu blic: __thiscall boost::gregorian::greg_month::greg_month(unsigned short)" (_im p??0greg_month@gregorian@boost@@QAE@G@Z) referenced in function "public: __this call boost::gregorian::date::date(enum boost::date_time::special_values)" (??0da te@gregorian@boost@@QAE@W4special_values@date_time@2@@Z) bin.v2\libs\thread\build\msvc-11.0\release\threading-multi\boost_thread-vc110-mt -1_54.dll : fatal error LNK1120: 1 unresolved externals

Any help is greatly appreciated. Thanks

1
is this Windows or posix? Given you say 'command prompt' I think Windows but just want to clarify. Also, are you wanting 32 or 64 bit libraries?Bathsheba
Yup windows 7, should have mentioned that !user1088794
Is that 64 or 32 bit Windows 7?Bathsheba
64bit, but I need the 32bit library file, so thats what I am compiling (which I believe is what compiles by default?).. I was able to compile all the 64bit library files successfullyuser1088794
See my answer; it removes this ambiguity. I have to build both 32 and 64 bit libraries.Bathsheba

1 Answers

2
votes

For 32 bit boost, start a 32 bit command prompt. (on 64 bit Windows you find this in C:\Windows\SysWOW64\cmd.exe). Then run "bootstrap.bat" from the Boost root directory. This creates an appropriate b2.exe. Then run

b2 link=shared address-model=32

your command as before. (Although I noticed you tagged boost-thread; to build just the thread libraries, append--with-thread to the command).

For 64 bit boost (on 64 bit OS), start a 64 bit command prompt (C:\Windows\System32\cmd.exe). Yes I know that looks odd but, trust me. Run "boostrap.bat" again, then

b2 link=shared address-model=64