Linker error: /usr/bin/ld: cannot find -lgcc_s
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I am trying to compile symlinks
(tar.gz-file), which is a very small tool with one line for compilation:
gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c
which gives the error
....
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
The output of
/sbin/ldconfig -p | grep libgcc
is
libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1
and trying to include the mentioned directory directly
gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/ -O2 -N -s -o symlinks symlinks.c
produces the same error.
Three questions:
- Why does it not work with the first command, as the lib seems to be in the search path
- Why does including the path itself does not help
- How to fix this?
ubuntu gcc
add a comment |Â
up vote
3
down vote
favorite
I am trying to compile symlinks
(tar.gz-file), which is a very small tool with one line for compilation:
gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c
which gives the error
....
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
The output of
/sbin/ldconfig -p | grep libgcc
is
libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1
and trying to include the mentioned directory directly
gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/ -O2 -N -s -o symlinks symlinks.c
produces the same error.
Three questions:
- Why does it not work with the first command, as the lib seems to be in the search path
- Why does including the path itself does not help
- How to fix this?
ubuntu gcc
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
The given link forsymlinks
is broken.
â Faheem Mitha
May 29 '17 at 23:26
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am trying to compile symlinks
(tar.gz-file), which is a very small tool with one line for compilation:
gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c
which gives the error
....
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
The output of
/sbin/ldconfig -p | grep libgcc
is
libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1
and trying to include the mentioned directory directly
gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/ -O2 -N -s -o symlinks symlinks.c
produces the same error.
Three questions:
- Why does it not work with the first command, as the lib seems to be in the search path
- Why does including the path itself does not help
- How to fix this?
ubuntu gcc
I am trying to compile symlinks
(tar.gz-file), which is a very small tool with one line for compilation:
gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c
which gives the error
....
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
The output of
/sbin/ldconfig -p | grep libgcc
is
libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1
and trying to include the mentioned directory directly
gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/ -O2 -N -s -o symlinks symlinks.c
produces the same error.
Three questions:
- Why does it not work with the first command, as the lib seems to be in the search path
- Why does including the path itself does not help
- How to fix this?
ubuntu gcc
ubuntu gcc
edited Nov 13 '13 at 16:17
asked Nov 13 '13 at 16:09
Alex
1,629154270
1,629154270
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
The given link forsymlinks
is broken.
â Faheem Mitha
May 29 '17 at 23:26
add a comment |Â
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
The given link forsymlinks
is broken.
â Faheem Mitha
May 29 '17 at 23:26
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
The given link for
symlinks
is broken.â Faheem Mitha
May 29 '17 at 23:26
The given link for
symlinks
is broken.â Faheem Mitha
May 29 '17 at 23:26
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Solution: Omitting the option -N
.
1
Why does this work? I can only figure out thatman ld
suggests-N
disables linking against shared libraries (among many other things).
â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of-N
on the man pages. Without deeper investigation I cannot say what-N
does or did.
â Alex
Nov 14 '13 at 6:44
@Alex please don't mixgcc
andld
flags. They are totally different. If you want static linking in gcc, use-static
. Also you could be interesting in-static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.
â Netch
Aug 30 '14 at 6:16
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Solution: Omitting the option -N
.
1
Why does this work? I can only figure out thatman ld
suggests-N
disables linking against shared libraries (among many other things).
â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of-N
on the man pages. Without deeper investigation I cannot say what-N
does or did.
â Alex
Nov 14 '13 at 6:44
@Alex please don't mixgcc
andld
flags. They are totally different. If you want static linking in gcc, use-static
. Also you could be interesting in-static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.
â Netch
Aug 30 '14 at 6:16
add a comment |Â
up vote
0
down vote
Solution: Omitting the option -N
.
1
Why does this work? I can only figure out thatman ld
suggests-N
disables linking against shared libraries (among many other things).
â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of-N
on the man pages. Without deeper investigation I cannot say what-N
does or did.
â Alex
Nov 14 '13 at 6:44
@Alex please don't mixgcc
andld
flags. They are totally different. If you want static linking in gcc, use-static
. Also you could be interesting in-static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.
â Netch
Aug 30 '14 at 6:16
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Solution: Omitting the option -N
.
Solution: Omitting the option -N
.
answered Nov 13 '13 at 16:42
Alex
1,629154270
1,629154270
1
Why does this work? I can only figure out thatman ld
suggests-N
disables linking against shared libraries (among many other things).
â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of-N
on the man pages. Without deeper investigation I cannot say what-N
does or did.
â Alex
Nov 14 '13 at 6:44
@Alex please don't mixgcc
andld
flags. They are totally different. If you want static linking in gcc, use-static
. Also you could be interesting in-static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.
â Netch
Aug 30 '14 at 6:16
add a comment |Â
1
Why does this work? I can only figure out thatman ld
suggests-N
disables linking against shared libraries (among many other things).
â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of-N
on the man pages. Without deeper investigation I cannot say what-N
does or did.
â Alex
Nov 14 '13 at 6:44
@Alex please don't mixgcc
andld
flags. They are totally different. If you want static linking in gcc, use-static
. Also you could be interesting in-static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.
â Netch
Aug 30 '14 at 6:16
1
1
Why does this work? I can only figure out that
man ld
suggests -N
disables linking against shared libraries (among many other things).â Anko
Nov 13 '13 at 21:43
Why does this work? I can only figure out that
man ld
suggests -N
disables linking against shared libraries (among many other things).â Anko
Nov 13 '13 at 21:43
The version of gcc installed does not provide any help of
-N
on the man pages. Without deeper investigation I cannot say what -N
does or did.â Alex
Nov 14 '13 at 6:44
The version of gcc installed does not provide any help of
-N
on the man pages. Without deeper investigation I cannot say what -N
does or did.â Alex
Nov 14 '13 at 6:44
@Alex please don't mix
gcc
and ld
flags. They are totally different. If you want static linking in gcc, use -static
. Also you could be interesting in -static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.â Netch
Aug 30 '14 at 6:16
@Alex please don't mix
gcc
and ld
flags. They are totally different. If you want static linking in gcc, use -static
. Also you could be interesting in -static-libgcc
. They are tons of undocumented gcc flags because it converts virtually all input flags to internal form before reprocessing, so don't surprise on unexpected result from undocumented flags.â Netch
Aug 30 '14 at 6:16
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f101043%2flinker-error-usr-bin-ld-cannot-find-lgcc-s%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
EDIT: The original command is as posted in the edited question.
â Alex
Nov 13 '13 at 16:17
What does 'echo $PATH' say?
â schaiba
Nov 13 '13 at 16:39
I found the solution in the meantime, thanks for making your suggestion.
â Alex
Nov 13 '13 at 16:43
The given link for
symlinks
is broken.â Faheem Mitha
May 29 '17 at 23:26