fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_43.lib'

65,240

Solution 1

You need to use bjam. It is responsible for creating the libraries that your application will use. Once you use bjam, you are going to need to instruct your project to include the lib file. You do this by going into the project's properties -> Configuration Properties -> Linker -> General. Add the directory which created the lib file to Additional Library Directories. You should be capable of correctly linking after that. I believe that this link describes the steps better than I could attempt in a post

Solution 2

@bogertron: I want to hug you! (:

So, at last, with a real head ache, I've managed to do so.

The exact steps I took, so others will be saved from the head ache:

  1. Went to http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html#or-build-binaries-from-source .

  2. Followed the "5.3.1 Get bjam" clause. Downloaded the "pre-built bjam executable for your platform" at this URL: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941 .

  3. Extracted the ZIP file (my platform is Windows).

  4. Ran "build.bat". It produced the file "bin.ntx86/bjam.exe".

  5. Copied this file to my PATH ("...../boost_1_43_0/").

  6. From a command line, executed "bjam.exe" and waited for about 4-5 minutes.

Then got this message at the console: "The Boost C++ Libraries were successfully built!"

That's it, it even tells you where the include & lib files are.

Solution 3

Not all Boost libraries are header only, Boost.System is one of them. The documentation for Boost.Asio tells you that it depends on Boost.System.

With Visual Studio, the Boost libraries use auto-linking, which means you don't have to explicitly link to the libraries you need. You however need to have the necessary libraries in the library search path, either globally or per-project.

If you don't want to build the Boost libraries yourself, you can use the installers provided by boostpro (only up to Boost 1.42 though at the moment). If you want to build them yourself instead, the documentation covers that well.

Solution 4

I had the same error and i followed the SourceForge. The link will take you to a folder of zipped lib and dll files for version of boost.You can download and unzip related library and when copied it to the related location everything gonna be alright ;)

Share:
65,240
Poni
Author by

Poni

Updated on July 09, 2022

Comments

  • Poni
    Poni almost 2 years

    Made a new project, added main.cpp and wrote the code at this URL:

    http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp

    Also, added the appropriate include path.

    What's next?!?!! It seems like a darn mystery to build a boost code!

    Been digging on it for more than 10 hours.

    Can anyone give a straightforward answer on how to build the boost library from the code under windows, VC9?

  • Brent
    Brent almost 13 years
    all I had to do was add C:\Boost\x86\lib to the Additional Library Directories mentioned above
  • Siarhei Kuchuk
    Siarhei Kuchuk almost 12 years
    in 1.5 <boost root>\stage\lib should be added.