Cppunit wont link without -Wl,--no-as-needed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cppunit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I may be doing something stupid here, but I think it's a bug with the package in precise, since it used to work before I upgraded.
I definitely have libcppunit and -dev installed:
$ apt-cache policy libcppunit-dev
libcppunit-dev:
Installed: 1.12.1-4
Candidate: 1.12.1-4
Version table:
*** 1.12.1-4 0
500 http://
100 /var/lib/
$ apt-cache policy libcppunit-1.12-1
libcppunit-1.12-1:
Installed: 1.12.1-4
Candidate: 1.12.1-4
Version table:
*** 1.12.1-4 0
500 http://
100 /var/lib/
$ ls /usr/lib/ | grep cppunit
libcppunit-
libcppunit-
libcppunit.a
libcppunit.la
libcppunit.so
$ sudo ldconfig -p |grep cppunit
libcppunit-
But if I try to link with the attached sample program I get linker errors:
$ g++ -lcppunit -o test.bin test.cpp
/tmp/ccoQDuGC.o: In function `main':
test.cpp:
test.cpp:
test.cpp:
test.cpp:
test.cpp:
test.cpp:
test.cpp:
test.cpp:
test.cpp:
collect2: ld returned 1 exit status
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libcppunit-1.12-1 1.12.1-4
ProcVersionSign
Uname: Linux 3.2.0-23-generic x86_64
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
Date: Thu Apr 19 13:21:45 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
LANGUAGE=en_CA:en
TERM=xterm
PATH=(custom, no user)
LANG=en_CA.UTF-8
SHELL=/bin/bash
SourcePackage: cppunit
UpgradeStatus: Upgraded to precise on 2012-04-02 (17 days ago)
Current work around is to add "-Wl,-- no-as-needed" before "-lcppunit". So this leads me to believe the package might not have been built properly.