Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2005-12-15 15:31:59


Imran,

>>> .....mingw32\bin\ld.exe: cannot find -lboost_thread

OK, I see two problems here.

First, are you calling ld.exe directly to link your executable,
or are you calling either gcc or g++? I initially made the mistake
of calling ld.exe directly, but found the linker couldn't even find
the C++ functions in std namespace. I was told to use gcc or
g++ because they know to automatically include the standard
runtime libraries.

Second, -lboost_thread would work only if you have a -L<directory>
where <directory> is where the Boost libraries are AND the Boost
library file was named "libboost_thread.dll" or "libboost_thread.lib".
That is, the -l option only takes care of the "lib" prefix and the
".dll" or ".lib" file extension, depending on whether you are linking
to shared or static libraries.

When Boost builds its libraries, it add a suffix to the library name
that records the major build options (which compiler, static? debug?
multi-thread? etc.). So, I'm betting that in your Boost library
directory you do NOT have a file named libboost_thread.dll
or libboost_thread.lib.

You need to include that filename suffix (and I'm talking about the
filename and not the file extension) in the argument to the -l option.

What is the full filename of the boost_thread library in the Boost
libs directory?

Merrill


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net