c++ - ld: cannot find -lstdc++ -
i trying break down compilation these 4 steps, last 1 seems problematic me.
cpp hello.cpp > hello.i g++ -s hello.i -o hello.o hello.s ld -o hello hello.o -lstdc++
i searched problem on here , here, didn't help.
running in verbose mode gave me
attempt open hello.o succeeded hello.o attempt open /usr/i686-linux-gnu/lib32/libstdc++.so failed attempt open /usr/i686-linux-gnu/lib32/libstdc++.a failed attempt open //usr/local/lib32/libstdc++.so failed attempt open //usr/local/lib32/libstdc++.a failed attempt open //lib32/libstdc++.so failed attempt open //lib32/libstdc++.a failed attempt open //usr/lib32/libstdc++.so failed attempt open //usr/lib32/libstdc++.a failed attempt open //usr/local/lib/i386-linux-gnu/libstdc++.so failed attempt open //usr/local/lib/i386-linux-gnu/libstdc++.a failed attempt open //usr/local/lib/libstdc++.so failed attempt open //usr/local/lib/libstdc++.a failed attempt open //lib/i386-linux-gnu/libstdc++.so failed attempt open //lib/i386-linux-gnu/libstdc++.a failed attempt open //lib/libstdc++.so failed attempt open //lib/libstdc++.a failed attempt open //usr/lib/i386-linux-gnu/libstdc++.so failed attempt open //usr/lib/i386-linux-gnu/libstdc++.a failed attempt open //usr/lib/libstdc++.so failed attempt open //usr/lib/libstdc++.a failed ld: cannot find -lstdc++
any suggestions? in advance.
instead of invoking linker directly, try calling indirectly through gcc
or g++
:
cpp hello.cpp > hello.i g++ -s hello.i -o hello.o hello.s g++ -o hello hello.o
Comments
Post a Comment