Boost logo

Boost Users :

From: subsample (knuarv_at_[hidden])
Date: 2003-04-23 12:47:38


--- In Boost-Users_at_[hidden], "Ben Hutchings" <ben.hutchings_at_b...> wrote:
> ld doesn't work this way. -l is just a shortcut for finding a library
> file. The libraries specified with -l are part of the file list, same
> as the object files and any library files specified by their full file
> name. The nasty thing is that backwards references are only resolved
> in object files, not in library files, so library files must be listed
> after the object files (and any other library files) that reference
> them.
>
> You need to take the libraries from LDFLAGS (perhaps into another
> variable) and put them at the end of the command line.
>
> Also you should be using CXX and CXXFLAGS for compiling C++ code, not
> CC and CFLAGS.
>
> Since you're building a pthreads program, you *must* define the macro
> _REENTRANT to get a threadsafe C library. As a shortcut, include
> -pthread in CXXFLAGS (this causes linking with -lpthread, too).

Ok, thanks for clearing this out.


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