My C++ application works fine with default dynamic linking, but... I'm trying to statically link all libraries to the application as unfortunately users cannot seem to install appropriate libraries (or more precisely their ISPs won't on servers in use). So I added -static as a link option.
LD fails trying to open libgcc_s.a which seems wrong.
LD does successfully open libgcc.a
If I understand correctly (and please correct me if I'm in error!):
- libgcc_s is the shared version of libgcc, an so shared object.
A statically linked executable should only be using libgcc.a, not libgcc_s right? - other than -static, what linker arguments do I need to specify? It seems to be finding everything else it needs in .a flavor.
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 Copyright (C) 2013 Free Software Foundation, Inc.
$ uname -s -r --m
Linux 3.19.0-51-generic x86_64
Thanks in advance for any assistance, Best Regards, Dave
PS:
g++ -Xlinker -static -o "airparse" ./src/ArcBuild.o ./src/ParsTool.o ./src/airparse.o ./src/airway.o ./src/coordint.o ./src/mapBuild.o
./src/mapdata.o ./src/n_assert.o
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make: *** [airparse] Error 1