Bug#799217: clang linker fails with undefined reference when compiling with boost_unit_test_framework

Johannes Schauer josch at debian.org
Wed Sep 16 21:47:22 UTC 2015


Package: clang
Version: 1:3.5-26
Severity: normal

Hi,

steps to reproduce:

	$ sudo debootstrap unstable debian-unstable http://127.0.0.1:3142/httpredir.debian.org/debian
	[...]
	$ sudo chroot debian-unstable apt-get install libboost-test-dev clang --no-install-recommends
	[...]
	$ cat << END | sudo tee debian-unstable/boost_test_test.cc > /dev/null
	#define BOOST_TEST_DYN_LINK
	#define BOOST_TEST_MODULE scanio
	#include <boost/test/unit_test.hpp>
	BOOST_AUTO_TEST_CASE(foo) { BOOST_CHECK(1); }
	END
	$ sudo chroot debian-unstable clang++ boost_test_test.cc -lboost_unit_test_framework
	/tmp/boost_test_test-4c8caa.o: In function `boost::unit_test::make_test_case(boost::unit_test::callback0<boost::unit_test::ut_detail::unused> const&, boost::unit_test::basic_cstring<char const>)':
	boost_test_test.cc:(.text._ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE[_ZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE]+0x58): undefined reference to `boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)'
	clang: error: linker command failed with exit code 1 (use -v to see invocation)

The last command succeeds when using g++ which is why I'm reporting this
against clang instead of boost. Please reassign as appropriate.

Thanks!

cheers, josch



More information about the Pkg-llvm-team mailing list