Sorry, I understand that questions very similar to this have been asked relatively frequently, although none of the solutions seem to work for me. When I try to run any C ++ code with reasonable complexity, I get the above error. Full error message:
/main: relocation error: ./main: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
starting another project, I get a very similar error:
./main: relocation error: ./main: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
I actually have no problems with compilation, as these projects compile fine. This happens when I try to run an executable. I thought this was a mistake with my gcc installation, so today I reinstalled it, although that didn't help at all. I really don't know what to do to fix this, can anyone offer help?
This is the Makefile that I use to compile one of the projects, I feel it might be a bug:
CC= g++ CFLAGS= -Wall -g -std=c++11 -lX11 -lpthread OBJS = main.o Board_Tile.o Sliding_Solver.o main: $(OBJS) $(CC) -o $@ $(OBJS) %.o : %.cc $(CC) $(CFLAGS) -c $^
My version of gcc is 5.3.0, I am running Ubuntu 14.0.4.
source share