How to link libstdc++ statically to shared lib project?
-
Hi All,
Problem abstract: I have build a code one gcc version and trying to run .out file in another gcc/g++ version PC, executable app not launching.I have tried to set the QMAKE_LFLAGS += -static-libgcc -static-libstdc++, is there any way to link the flags and also tried -Bstatic -lstdc++. these are doesn't work for me. Can you please help me on this issue.
-
@shyam_777 said in How to link libstdc++ statically to shared lib project?:
executable app not launching
Are you sure the problem is libstdc++?
I doubt it is going to work if you link libstdc++ statically, but other libraries dynamically - these other libraries will still expect other libstdc++ version. If you want to link statically then link all libs statically.
Or build on other PC with required libstdc++ version. -
Thank you Sir for reply,
"Are you sure the problem is libstdc++?"
Yeah sure , the app build in gcc 7.5 version in Jenkins and trying to launch in 16.04 with gcc version 5.4 , app is not launching . Installed 8.4 gcc version and then verified app is launching.