Boost logo

Boost :

From: Christo Fogelberg (cgf_at_[hidden])
Date: 2003-05-29 06:06:48

Hi everyone,

Another silly newbie question: I'm having real difficulty getting my own
programmes to compile with boost (specifically the boost unit test

Here's my install procedure (just redid it to make sure I did things 'by
the book'):
(Not the exact commands obviously:)
cd /usr/local/boost
tar -zxvf boost.tar.gz
mv boost.x.x.x boost
/usr/local/boost/tools/build/jam_src/ (to build bjam)
    (this runs to completion just fine - says it updated 7 targets)
in /usr/local/boost: {full path to bjam just built}/bjam "-sTOOLS=gcc"
    no error messages (except for Python, but that's expected),
    and it updated 425 targets.

However, when I try to compile the following code from the directory

/////////////////////// START CODE ///////////////////
// Boost Unit Test Library:
#include <boost/test/unit_test.hpp>
#include <boost/test/included/test_exec_monitor.hpp>

// Individual Components:
// None - just a clean compile would be nice!

using namespace boost::unit_test_framework;

test_suite* init_unit_test_suite(int argc, char* argv[]) {
    test_suite* test= BOOST_TEST_SUITE("testtest");
    return test;
////////////////////////// END CODE ////////////////////////

Using the commands:
gcc -c -Wall -pedantic -Wformat -I/usr/local/boost/ test.cpp
gcc -Wall -pedantic -Wformat -L/usr/local/boost -o test.out
test.o -lstdc++

I get the following error message:

test.o: In function `{anonymous}::call_test_main(void)':
test.o(.text+0x5631): undefined reference to `test_main(int, char **)'

(Minor note: the compilation spits out warnings about long long,
probably due to pedantic:)

Finally, I have GCC 2.95 installed, and the regression tests and
examples all build and run... so what am I doing wrong? :-(

Thanks in advance for any help!

Boost list run by bdawes at, gregod at, cpdaniel at, john at