Boost logo

Boost Users :

Subject: Re: [Boost-users] segfault using boost test
From: Jürgen Hunold (juergen.hunold_at_[hidden])
Date: 2010-11-09 14:50:25


Hi Dave,

On Tuesday, 9. November 2010 17:46:35 David M.Lee wrote:
> If I #include <boost/test/unit_test.hpp>, I get a linker error:
>
> g++ -o simple-test simple-test.cpp -lboost_unit_test_framework
> Undefined symbols:
> "_main", referenced from:
> start in crt1.10.6.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status

main() is normally defined by BOOST_TEST_MODULE if BOOST_TEST_DYN_LINK is also
defined. Seems the latter is missing on your command line.

#define BOOST_TEST_MODULE simple
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_CASE(testSimple)
{
   BOOST_CHECK_EQUAL(true, true);
}

If this does not help, please provide a complete testcase. (bjam driven
preferred).

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

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