Boost logo

Boost Users :

From: Nicholas Cain (nik.cain.boost_at_[hidden])
Date: 2004-06-26 07:34:59


I'm new to boost, stlport and programming on linux in general, so I
apologise now for any obvious beginner errors!

I'm using mandrake 10 and gcc 3.3.2, and using root I created STLport
4.6.2 libraries, and then created all the boost 1.31.0 libraries using

bjam -sTOOLS=gcc-stlport -sBUILD="debug release <stlport-iostream>on"

I had to have this little lot in my bashrc file to do it;

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export STLPORT_VERSION=4.6.2
export STLPORT_ROOT=/home/ncain
export STLPORT_LIB_DIRECTORY=/usr/local/lib
export STLPORT_INCLUDE_DIRECTORY=/usr/local/include/
export PYTHON_ROOT=/usr

Everything seemed to build ok, apart from an
"../lib/ does not exist" error in the final part
of the stlport build and a continual "warning: "_POSIX_C_SOURCE"
redefined" warning during the boost build. Both the stlport and boost
libraries are in /usr/local/lib ok, and building thread/test passed fine

I altered one of the tutorial files to use _STL and also created a
makefile (since bjam is a bit beyond me at the moment), and these appear as;

#include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp>
#include <iostream>

using namespace _STL;

struct thread_alarm
    thread_alarm(int secs) : m_secs(secs) { }
    void operator()()
        cout << "alarm sounded..." << endl;

    int m_secs;

int main(int argc, char* argv[])
    int secs = 5;
    thread_alarm alarm(secs);
    boost::thread thrd(alarm);


.PHONY: all clean
ALL = testboost
INCS = -I"/usr/local/include/stlport" \

LIBS=-L"/usr/local/lib" -lstlport_gcc -lboost_thread-gcc-mt-p -lpthread

    ${CXX} ${INCS} -pthread -o $@ $^ ${LIBS}

all: ${ALL}

    ${RM} core* *.o
    ${RM} ${ALL}

make returns this error;
g++ -I"/usr/local/include/stlport" -I"/usr/local/include/boost-1_31"
-pthread -o testboost testboost.cpp -L"/usr/local/lib" -lstlport_gcc
-lboost_thread-gcc-mt-p -lpthread
/home/ncain/tmp/ccZWBPnj.o(.text+0x4b): In function `main':
: undefined reference to
_STL::allocator<boost::function_base> > const&)'
collect2: ld returned 1 exit status
make: *** [testboost] Error 1

using -lboost_thread-gcc-mt-gdp makes no difference, however changing
the cpp to use the std libraries works fine (builds and runs correctly).

Have I made a mistake in building the boost libraries or possibly in my


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at