You are not logged in.

#1 2011-12-10 00:01:11

seniorsassycat
Member
Registered: 2011-08-27
Posts: 76

gcc issues /usr/lib/libstdc++.so.6:could not read symbols

Error i get when compiling an openGL, bullet program. I just started getting this on both my arch computers after updating.

 gcc Timer.o Ball.o main.o -I/usr/include -lGL -lGLU -lBulletCollision -lBulletDynamics -lLinearMath -I/usr/include/bullet -L/usr/lib -lglut -lX11  -o pool
/usr/bin/ld: Ball.o: undefined reference to symbol '__cxa_pure_virtual@@CXXABI_1.3'
/usr/bin/ld: note: '__cxa_pure_virtual@@CXXABI_1.3' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line
/usr/lib/libstdc++.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status 

Offline

#2 2011-12-10 00:06:49

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,404
Website

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

The error tells you what to do...

/usr/bin/ld: note: '__cxa_pure_virtual@@CXXABI_1.3' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line

Offline

#3 2011-12-10 00:10:39

seniorsassycat
Member
Registered: 2011-08-27
Posts: 76

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

Could you explain what that means?

Offline

#4 2011-12-10 01:08:59

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

You're using gcc to compile a c++ program. Stop that. Use the proper frontend, g++.

Offline

#5 2011-12-10 01:15:42

seniorsassycat
Member
Registered: 2011-08-27
Posts: 76

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

I realised that  and changed it, it's still giving a simmilar error

g++ Timer.o Ball.o main.o -I/usr/include -lGL -lGLU -lBulletCollision -lBulletDynamics -lLinearMath -I/usr/include/bullet -L/usr/lib -lglut -lX11  -o pool
/usr/bin/ld: Timer.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5'
/usr/bin/ld: note: 'clock_gettime@@GLIBC_2.2.5' is defined in DSO /lib/librt.so.1 so try adding it to the linker command line
/lib/librt.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

Last edited by seniorsassycat (2011-12-10 01:16:00)

Offline

#6 2011-12-10 01:17:17

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

So add the linker flag.. -lrt in this case.

Offline

#7 2011-12-10 01:27:03

seniorsassycat
Member
Registered: 2011-08-27
Posts: 76

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

falconindy wrote:

So add the linker flag.. -lrt in this case.

Thanks, that worked, do you know why this broke? Before i ran pacman -Syu i did not need to include rt, but now i do on both systems.

Last edited by seniorsassycat (2011-12-10 01:36:19)

Offline

#8 2011-12-10 01:40:36

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

Changes to the toolchain, I guess.

Offline

#9 2011-12-10 08:56:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,404
Website

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

Read the first change with binutils-2.22:
http://sourceware.org/cgi-bin/cvsweb.cg … utils-2_22

And here is some explanation:
http://fedoraproject.org/wiki/Understan … LinkChange

Offline

#10 2012-04-27 15:12:37

mtbrooks33
Member
Registered: 2011-06-08
Posts: 52

Re: gcc issues /usr/lib/libstdc++.so.6:could not read symbols

hate to revive this, but I am having the same error installing mixxx-bzr from the AUR. How / where do i add that '-lrt' flag?

Offline

Board footer

Powered by FluxBB