[pkg-boost-devel] Bug#516879: libboost-test1.34.1: Can't find main; no gcc4.2 unit_test files?
Ross Boylan
RossBoylan at stanfordalumni.org
Tue Feb 24 07:44:01 UTC 2009
Package: libboost-test1.34.1
Version: 1.34.1-14
Severity: normal
Following the directions at file:///usr/share/doc/libboost-doc/HTML/libs/test/doc/components/utf/components/test_case/auto_register_facility.html create foo.cc:
---------------------------------------
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
BOOST_AUTO_TEST_CASE(test1){
BOOST_CHECK(1);
}
-----------------------------------
When I try to build:
$ g++ -o foo.out foo.cc -lboost_unit_test_framework
/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
Notes:
1. The test framework's documentation says documentation may not be current:
file:///usr/share/doc/libboost-doc/HTML/libs/test/doc/index.html#ReleaseNotes
notes "I may not be able to make all necessary changes in
documentation within bounds of this release.". This was my best guess
about what was required. I have been able to use the framework in
earlier releases. The release notes do note substantial changes in
the unit tests, including automatic ones.
2. I have had earlier versions on the system; some are still there:
,----[ ls -l /usr/lib/libboost_unit* ]
| lrwxrwxrwx 1 root root 43 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework.a -> libboost_unit_test_framework-gcc42-1_34_1.a
| lrwxrwxrwx 1 root root 51 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-gcc41-1_34_1.so.1.34.1 -> libboost_unit_test_framework-gcc42-1_34_1.so.1.34.1
| lrwxrwxrwx 1 root root 54 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-gcc41-mt-1_34_1.so.1.34.1 -> libboost_unit_test_framework-gcc42-mt-1_34_1.so.1.34.1
| -rw-r--r-- 1 root root 588032 2008-11-01 03:07 /usr/lib/libboost_unit_test_framework-gcc42-1_34_1.a
| lrwxrwxrwx 1 root root 51 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-gcc42-1_34_1.so -> libboost_unit_test_framework-gcc42-1_34_1.so.1.34.1
| -rw-r--r-- 1 root root 252124 2008-11-01 03:07 /usr/lib/libboost_unit_test_framework-gcc42-1_34_1.so.1.34.1
| -rw-r--r-- 1 root root 588032 2008-11-01 03:07 /usr/lib/libboost_unit_test_framework-gcc42-mt-1_34_1.a
| lrwxrwxrwx 1 root root 54 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-gcc42-mt-1_34_1.so -> libboost_unit_test_framework-gcc42-mt-1_34_1.so.1.34.1
| -rw-r--r-- 1 root root 252204 2008-11-01 03:07 /usr/lib/libboost_unit_test_framework-gcc42-mt-1_34_1.so.1.34.1
| lrwxrwxrwx 1 root root 46 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-mt.a -> libboost_unit_test_framework-gcc42-mt-1_34_1.a
| lrwxrwxrwx 1 root root 47 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework-mt.so -> libboost_unit_test_framework-gcc42-mt-1_34_1.so
| lrwxrwxrwx 1 root root 44 2008-11-12 16:19 /usr/lib/libboost_unit_test_framework.so -> libboost_unit_test_framework-gcc42-1_34_1.so
`----
3. I am using gcc 4.3, which I think is the Lenny default. There does
not seem to be a gcc43 version above. Perhaps that is the problem?
(But it's hard to believe it would be unable to find the symbol for
main).
4.
nm -C /usr/lib/libboost_unit_test_framework.a | grep main
finds an entry for main, but when done against the .so produces only a
"no symbols" warning. I don't know if it should do better.
5. I have pentium-builder installed, which puts a wrapper around g++.
Invoking g++-4.3 directly leads to the same results as above.
-- System Information:
Debian Release: 5.0
APT prefers stable
APT policy: (990, 'stable'), (500, 'oldstable'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libboost-test1.34.1 depends on:
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libgcc1 1:4.3.2-1.1 GCC support library
ii libstdc++6 4.3.2-1.1 The GNU Standard C++ Library v3
libboost-test1.34.1 recommends no packages.
libboost-test1.34.1 suggests no packages.
-- no debconf information
More information about the pkg-boost-devel
mailing list