On Mon, May 11, 2009 at 1:25 PM, [email protected] <[email protected]> wrote:
>
> Hi,
> I am running a simple socket example of boost.asio library. i am getting the
> following error. can any one help me in this regard.
>
> here is the example code:
> http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/tutorial/tutdaytime1/src.html
>
> I am buinding it in eclipse and mingw.
>
> Description Resource Path Location Type
> C:/boost_1_38_0/boost/system/error_code.hpp undefined reference to
> `boost::system::get_generic_category()' sock1 206 C/C++ Problem
I would venture to guess you aren't linking against the correct boost
library. Are you using an external makefile that Eclipse runs or are
you letting Eclipse handle the dependencies? If you are using a
makefile, you need to make sure you have the boost libraries in your
linker search path (gcc uses -L for this) and also make sure you have
the correct boost library listed with the linker (gcc uses -l for
this).
Something like
gcc -o <target_executable> -L/path/to/boost -lboost
If you are letting Eclipse handle the library dependencies, you need
to open the Properties for your project and add the pathes and
libraries under 'C/C++ Project Paths' so Eclipse knows where to find
the libraries.
-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi