Re: [mongodb-dev] Error when building MongoDB from source on Windows 7 64 LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_42.lib'

Skip to first unread message

Eric Milkie

unread,
Aug 22, 2012, 9:35:51 PM8/22/12
to mongo...@googlegroups.com
Hi Mark.
C:\boost\stage\lib is not provided as a LIBPATH on the linker command line. See http://www.mongodb.org/display/DOCS/Boost+and+Windows
For version 2.0.7 and below, you must put your Boost libraries in C:\boost\lib; this is where the MongoDB SConstruct is configured to look for it.

You can also try using version 2.2.0rc2; Boost is included in the distribution and you don't have to build it yourself.
-Eric


On Aug 22, 2012, at 8:44 PM, Therefore <therefo...@gmail.com> wrote:

Windows 7 64 SP1
MongoDB 2.0.7
Boost 1.42
MS VS 2010 Ultimate

Trying to build MongoDB from source.

I downloaded 2.0.7 with Git. Then:

      scons --64
     
Errors out with:

            LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_42.lib'
           
This exits in C:\boost\stage\lib.

I had previously built boost with:

           bjam --build-type=complete msvc stage         
   
I didn't see any mention of this file in config.log. One of the last lines was:

link /nologo /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT /OUT:.sconf_temp\conftest_6.exe /LIBPATH:C:\boost\Lib "/LIBPATH:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64" /LIBPATH:C:\winpcap\Lib ws2_32.lib kernel32.lib advapi32.lib Psapi.lib wpcap.lib .sconf_temp\conftest_6.obj
LINK : fatal error LNK1181: cannot open input file 'wpcap.lib'
scons: Configure: no      

Thoughts?

Mark

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/ERmDCN81e90J.
To post to this group, send email to mongo...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.

Therefore

unread,
Aug 23, 2012, 3:06:23 AM8/23/12
to mongo...@googlegroups.com
Thank you Eric -- moving lib to the boost root worked.

However, apparently I'm just not getting how to build boost. Now my scon --64 gives me this:

libboost_filesystem-vc100-mt-gd-1_42.lib(operations.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
scons: building terminated because of errors.

I'm inferring that this means my boost library was built for x86 whereas I'm trying to build an x64 mongoDB.

Should I create another thread for this new issue?

Thanks,

Mark

Eric Milkie

unread,
Aug 23, 2012, 9:40:29 AM8/23/12
to mongo...@googlegroups.com
I use the prebuilt boost libraries available on the MongoDB website and it works for me in 64-bit mode.  Offhand I'm not sure how to build a boost library from scratch that's correct.
-Eric

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-dev/-/NyxYrZ--0ZAJ.

Pedro Larroy

unread,
Sep 13, 2012, 2:18:25 PM9/13/12
to mongo...@googlegroups.com
You can build boost from scratch by putting the following in a bat
file in boost root:

CALL "c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\vcvarsall.bat" amd64
CALL bootstrap.bat
set BASE=%CD%
b2 -j8 --toolset=msvc --build-type=complete address-model=64
--with-serialization --with-thread --with-date_time
--with-program_options --with-graph --with-filesystem --with-iostreams
--with-chrono --with-test define=arch:SSE2 link=static threading=multi
--stagedir="%BASE%"


Pedro.
Reply all
Reply to author
Forward
0 new messages