Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just upgraded gcc/g++ from 4.4 to 4.8 (via this method How can I update gcc to the latest version in Ubuntu 10.04?). I realized that 4.8 is going to break a lot of my code and now I want to roll back to 4.4. By sudo-apt-get removing 4.8 and clearing/changing my update alternatives, I shold be "back to normal". However, I have some compiler error:

scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/common/Obstacle/obj/libObstacle.so -Wl,-rpath=lib -Wl,-rpath=/usr/local/lib -Wl,-E -pthread -shared src/common/Obstacle/obj/Obstacle.os -Llib -L/usr/local/lib -lGL -lglut -lWorldModel
g++ -o src/common/MotionCommands/obj/libMotionCommands.so -Wl,-rpath=lib -Wl,-rpath=/usr/local/lib -Wl,-E -pthread -shared src/common/MotionCommands/obj/MotionCommands.os -Llib -L/usr/local/lib -lWorldModel
g++ -o src/xyz/AlignTool/obj/AlignTool -Wl,-rpath=lib -Wl,-rpath=/usr/local/lib -Wl,-E -pthread src/xyz/AlignTool/obj/AlignTool.o -Llib -L/usr/local/lib -ltask -lboost_serialization -lrecgeometry -lMovingTarget
/usr/bin/ld: src/xyz/AlignTool/obj/AlignTool.o: undefined reference to symbol 'ConfigSection::getCValue(unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool&, bool)'
/usr/bin/ld: note: 'ConfigSection::getCValue(unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool&, bool)' is defined in DSO lib/libconfig.so so try adding it to the linker command line
lib/libconfig.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
g++ -o src/behaviors/obj/DK.o -c -fPIC -Wall -Winit-self -O3 -g3 -pthread -Isrc/common -Ibackground/include -I/usr/lib/ruby/1.8/x86_64-linux src/behaviors/DK.cc
scons: *** [src/xyz/AlignTool/obj/AlignTool] Error 1
scons: building terminated because of errors.

What am I missing? What changed? How can I fix this? (I'm not sure how vague this question is, so if you need more info lemme know).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Apparently this is not at all easy. I just had to suck it up and reintall Ubuntu.

share|improve this answer

Actually, I do this all the time in Ubuntu 10.04 and it seems to work fine. Between builds I do a really clean build and delete all artifacts so there isn't a mix of files compiled with and without the newer compiler.

I install the newer compiler using:

sudo apt-get install g++-4.8 gcc-4.8

and uninstall it using

sudo apt-get autoremove g++-4.8 gcc-4.8 libstdc++-4.8-dev

but run the uninstall three times back-to-back to get rid of all the installed dependencies.

I am however using the newer binutils (2.22-4ubuntu1~10.04.1) with both GCC 4.4.3 and GCC 4.8.0 and the newer binutils may require more explicit linkage than the old. I'd start by just upgrading binutils and get everything to compile in 4.4.x first.

4.8.x and greater catches a lot more code issues so I'd use it to at least validate your 4.4.x code if you have to stick with the older compiler.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.