2

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

5
  • 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? Commented Sep 11, 2013 at 6:59
  • Yup windows 7, should have mentioned that ! Commented Sep 11, 2013 at 7:00
  • Is that 64 or 32 bit Windows 7? Commented Sep 11, 2013 at 7:01
  • 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 successfully Commented Sep 11, 2013 at 7:06
  • See my answer; it removes this ambiguity. I have to build both 32 and 64 bit libraries. Commented Sep 11, 2013 at 7:07

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

3 Comments

Yup that worked! I actually did this properly for the 64bit ones, but didnt think I needed address-model=32 for 32bit.. thought it was default? or maybe its because I wasnt running bootstrap before each time? Anyways thanks a lot!
No problem. I think the fault was with your not re-running bootstrap. But I put the address model in just to be sure. + by the way, if you append stage to the command line then it will create separate build directories for the build types.
@Bathsheba I have done the same but still could not solve the problem. I actually post the question in here: stackoverflow.com/questions/21578614/… Do you know anything about the problem? Could you help me please?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.