newb_k1dd
newb_k1dd

Reputation: 21

BOOST Version 1.46.1 with Visual Studio 2010 P.E

I'm trying to run some simple examples with Boost and I'm continuously running into this error and I have tried to compile this but I haven't been able to create "libboost_system-vc100-mt-gd-1_46_1.lib".

I keep ending up with this issue:

error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_46_1.lib'

Anyone encounter this error before? How do you compile this properly with NMAKE because it keeps telling me it's bulding "boost.regex without ICU / Unicode Support" which is giving it a "fatal error U1073 and tells me it doesn't know how to make "../src/c_regex_traits.cpp".

Sorry if this is a jumble it's just a lot of information that's getting more and more confusing to me.

Upvotes: 1

Views: 3366

Answers (5)

niels
niels

Reputation: 760

You need to build the boost libraries first.

To do this, open command line & go to boost root eg C:\dev\boost\1_46_1.

Depending on whether you want to build for 64bit or 32bit applications, type

(x64):bjam toolset=msvc address-model=64 variant=debug,release link=static threading=multi runtime-link=static,shared stage

(x86): bjam toolset=msvc variant=debug,release link=static threading=multi runtime-link=static,shared stage

to start compiling. Be patience while boost is building, it takes a lot of time. When building is complete you can find the library files in "stage\lib" folder.

Also note that you can delete the folder "bin.v2" once building is complete.

Now you need to point your VS2010 project to those libraries. Modifying part of mlimber's answer:

In VS2010, right-click on your project, select Properties and then go to Configuration Properties -> Linker -> General. Look for "Additional Library Directories" in the middle of the list, and add C:\Program Files\Boost\boost_1_46_1\lib (or whatever) there.

Another way to do this is the following

In VS2010, right-click on your project, select Properties and then go to Configuration Properties -> VC++ Directories. Look for "Library Directories" in the middle of the list, and add C:\Program Files\Boost\boost_1_46_1\lib (or whatever) there.


Apart from the above, one could also download from

http://sourceforge.net/projects/boost/files/boost-binaries/1.46.1/

the necessary libraries (including the file missing).

Upvotes: 3

Sharath
Sharath

Reputation: 1775

While trying to build Pion network library, I ran into a very similar problem since Pion has dependency on Boost library.

My Boost build was built using boostrap and bjam, and not BoostPro.

The error I got was this: LINK : fatal error LNK1104: cannot open file 'boost_thread-vc100-mt-gd-1_46_1.lib'

When I looked at C:\OpenSource\boost_1_46_1\stage\lib directory, I saw every file name started with libboost_ and not boost_. The file boost_thread-vc100-mt-gd-1_46_1.lib was clearly missing. That made me suspicious that not all boost libraries were built by bjam. After a little research, I reran bjam with the option --build-type=complete

Now I noticed that it started creating lib file names starting with boost_. Not to mention, Pion library could now compile successfully.

Hope this adds some clarity to this thread.

Upvotes: 2

metal
metal

Reputation: 6332

I take it that you used the BoostPro installer, but which library types did you install -- header only, static linking, DLLs, everything?

Assuming you did everything, then the problem is probably that you don't have the path to boost in your library paths. The problematic file name starts with "libboost" which tells me you're trying to use the statically linked version, which is fine. You should add the library path to your Makefile or project settings for all build configurations. It's probably something like C:\Program Files\Boost\boost_1_46_1 (for the newest version on a 32-bit version of Windows).

In VS2010, right-click on your project, select "All Configurations" at the top, then go to Configuration Properties | Linker [or Librarian if you're making a library] | General. Look for "Additional Library Directories" in the middle of the list, and add C:\Program Files\Boost\boost_1_46_1\lib (or whatever) there.

Do that for each project in the solution that uses Boost libraries that are not header-only.

For a Makefile, you'll have to locate the library paths and add Boost to it similarly but by hand.

Upvotes: 1

Ralf
Ralf

Reputation: 9573

Or alternatively to ybungalobill's suggestion use the installer from www.boostpro.com. In the installer you must just select the boost versions for msvc 10 and after installation update your visual studio include and lib directories in the VS2010 property sheets to point to the boost include and lib directory.

Upvotes: 1

Yakov Galka
Yakov Galka

Reputation: 72509

Your boost is not properly built or installed. Please follow the instruction on how to install boost.

Upvotes: 3

Related Questions