linking problem with libstdc++6, compilation fails

Bug #1185238 reported by Luc Pi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.7 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I am trying to compile gnote

everything goes fine until the last stage of linking the binary:

> CXX main.o
> CXXLD gnote
> /usr/bin/ld: addinstreemodel.o: undefined reference to symbol '_ZSt7nothrow@@GLIBCXX_3.4'
> /usr/bin/ld: note: '_ZSt7nothrow@@GLIBCXX_3.4' is defined in DSO /usr/lib/i386-linux-gnu/libstdc++.so.6 so try adding it to the linker command line
> /usr/lib/i386-linux-gnu/libstdc++.so.6: could not read symbols: Invalid operation
> collect2: error: ld returned 1 exit status

I first thought colorgcc could interfere, I disabled it, but it did not help.
I have tried to add /usr/lib/i386-linux-gnu to LD path, but it did not help.

Compilation was working just fine until recently (4-5 weeks maybe)
I have no idea what to try next.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: libstdc++6 4.7.3-1ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-22.33-generic 3.8.11
Uname: Linux 3.8.0-22-generic i686
ApportVersion: 2.9.2-0ubuntu8
Architecture: i386
Date: Wed May 29 05:10:33 2013
InstallationDate: Installed on 2012-09-20 (250 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120905.2)
MarkForUpload: True
SourcePackage: gcc-4.7
UpgradeStatus: Upgraded to raring on 2013-04-28 (30 days ago)

Revision history for this message
Luc Pi (oluc) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

re-run the package build in verbose mode and show the complete command line (not just CXXLD ...)

Changed in gcc-4.7 (Ubuntu):
status: New → Incomplete
Revision history for this message
Luc Pi (oluc) wrote :

How do I do this? (expand the CXXLD) ?

Revision history for this message
Luc Pi (oluc) wrote :

I got it.

$ make V=1
...
...
make[3]: Entering directory `/home/luc/desktop/dev/gnome/gnote.git/src'

/bin/bash ../libtool --tag=CXX --mode=link gcc -g -O2 -DNDEBUG -Wall -Wextra -Wsign-compare -Wpointer-arith -Wchar-subscripts -Wwrite-strings -Wunused -Wpointer-arith -Wshadow -fshow-column -export-dynamic -o gnote addinstreemodel.o actionmanager.o gnote.o preferencesdialog.o prefskeybinder.o recentchanges.o searchnoteswidget.o tagmanager.o tray.o xkeybinder.o notebookstreeview.o gnotesyncclient.o silentui.o syncdialog.o syncmanager.o remotecontrolproxy.o remotecontrol.o remotecontrolclient.o remotecontrol-client-glue.o remotecontrol-glue.o searchprovider.o main.o libgnote.la ../libtomboy/libtomboy.la -lglibmm-2.4 -lgobject-2.0 -lsigc-2.0 -lglib-2.0 -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -lxslt -lxml2 -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -luuid -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lX11

libtool: link: gcc -g -O2 -DNDEBUG -Wall -Wextra -Wsign-compare -Wpointer-arith -Wchar-subscripts -Wwrite-strings -Wunused -Wpointer-arith -Wshadow -fshow-column -o .libs/gnote addinstreemodel.o actionmanager.o gnote.o preferencesdialog.o prefskeybinder.o recentchanges.o searchnoteswidget.o tagmanager.o tray.o xkeybinder.o notebookstreeview.o gnotesyncclient.o silentui.o syncdialog.o syncmanager.o remotecontrolproxy.o remotecontrol.o remotecontrolclient.o remotecontrol-client-glue.o remotecontrol-glue.o searchprovider.o main.o -Wl,--export-dynamic ./.libs/libgnote.so ../libtomboy/.libs/libtomboy.a -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 /usr/lib/i386-linux-gnu/libcairomm-1.0.so /usr/lib/i386-linux-gnu/libsigc-2.0.so -lxslt -lxml2 -lgtk-3 -lgdk-3 -latk-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/i386-linux-gnu/libcairo-gobject.so -lpango-1.0 /usr/lib/i386-linux-gnu/libcairo.so -luuid -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lX11

/usr/bin/ld: addinstreemodel.o: undefined reference to symbol '_ZSt7nothrow@@GLIBCXX_3.4'

/usr/bin/ld: note: '_ZSt7nothrow@@GLIBCXX_3.4' is defined in DSO /usr/lib/i386-linux-gnu/libstdc++.so.6 so try adding it to the linker command line

/usr/lib/i386-linux-gnu/libstdc++.so.6: could not read symbols: Invalid operation

collect2: error: ld returned 1 exit status

Revision history for this message
Luc Pi (oluc) wrote :

libstdc++ is indeed missing from the linking line.

Revision history for this message
Luc Pi (oluc) wrote :

> I have tried to add /usr/lib/i386-linux-gnu to LD path, but it did not help.

This right above was a wrong statement. I tried to, but screwed the syntax.

Now I ran

$ LDFLAGS='-lstdc++ /usr/lib/i386-linux-gnu/libstdc++.so.6' ./configure
$ make V=1

and compilation completes.

I have no idea why libstdc++ is not in the ld path/flags
It used to work fine a few weeks ago.

Revision history for this message
Luc Pi (oluc) wrote :

Note: gnote master/HEAD compiles fine on gnote developers computer. (fedora?)

Revision history for this message
Matthias Klose (doko) wrote :

not a GCC issue. you better should use g++ when linking c++ code.

Changed in gcc-4.7 (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Luc Pi (oluc) wrote :

Yes, I don't recall I filed the bug report under gcc.

I am just typing 'make' to compile.

I think there is something wrong somewhere that in the last weeks it stopped just compiling.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.