Author Topic: Gcc Cannot Find -lc  (Read 9742 times)

Olivier

  • Newbie
  • *
  • Posts: 9
    • View Profile
Gcc Cannot Find -lc
« on: May 29, 2005, 02:51:31 pm »
evrything was fine, but when I lauch gcc from console  (gcc -o foo -lm foo.c), I ve got following error:

   "ld: cannot find -lc"

if I compile as root, i have got :
error while loading shared libraries: libopcodes-2.9.5.0.31.so: cannot load shared object file: no such file or directory

I try several workarounds without succes:
binutils & binutiks-dev ipk install
libstd6-1.2.2_arm.ipk install

I am not a specialist of gcc, but would like it to run in order to create my app, or to get source package et compile them.

Any help is welcome...

jfox

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://FoxFrenchTranslations.com/zaurus
Gcc Cannot Find -lc
« Reply #1 on: July 01, 2005, 02:32:03 am »
Quote
evrything was fine, but when I lauch gcc from console  (gcc -o foo -lm foo.c), I ve got following error:

   "ld: cannot find -lc"

if I compile as root, i have got :
error while loading shared libraries: libopcodes-2.9.5.0.31.so: cannot load shared object file: no such file or directory

I try several workarounds without succes:
binutils & binutiks-dev ipk install
libstd6-1.2.2_arm.ipk install

I am not a specialist of gcc, but would like it to run in order to create my app, or to get source package et compile them.

Any help is welcome...

[div align=\"right\"][a href=\"index.php?act=findpost&pid=82039\"][{POST_SNAPBACK}][/a][/div]

The error is saying that it cannot find "libc.so" in the path specified by $LIBRARY_PATH. If you are compiling on the Zaurus, you need to create a symbolic link from /lib/libc.so.6 to <path>/libc.so where <path> is in $LIBRARY_PATH. This may have to be done for a number of libraries: libm.so, libpthread.so, libncurses.so, etc.

Jeffrey Fox

jfox

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://FoxFrenchTranslations.com/zaurus
Gcc Cannot Find -lc
« Reply #2 on: July 01, 2005, 02:35:42 am »
Quote
evrything was fine, but when I lauch gcc from console  (gcc -o foo -lm foo.c), I ve got following error:

   "ld: cannot find -lc"

if I compile as root, i have got :
error while loading shared libraries: libopcodes-2.9.5.0.31.so: cannot load shared object file: no such file or directory

I try several workarounds without succes:
binutils & binutiks-dev ipk install
libstd6-1.2.2_arm.ipk install

I am not a specialist of gcc, but would like it to run in order to create my app, or to get source package et compile them.

Any help is welcome...

[div align=\"right\"][a href=\"index.php?act=findpost&pid=82039\"][{POST_SNAPBACK}][/a][/div]

The error is saying that it cannot find "libc.so" in the path specified by $LIBRARY_PATH. If you are compiling on the Zaurus, you need to create a symbolic link from /lib/libc.so.6 to <path>/libc.so where <path> is in $LIBRARY_PATH. This may have to be done for a number of libraries: libm.so, libpthread.so, libncurses.so, etc.

Jeffrey Fox

p. s. If you are using zgcc 2.02, then you are not correctly using zgcc.sh. Say
" . <pathto>/zgcc.sh" before compiling. Note the dot.

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gcc Cannot Find -lc
« Reply #3 on: August 21, 2005, 09:32:31 am »
Quote
The error is saying that it cannot find "libc.so" in the path specified by $LIBRARY_PATH. If you are compiling on the Zaurus, you need to create a symbolic link from /lib/libc.so.6 to <path>/libc.so where <path> is in $LIBRARY_PATH. This may have to be done for a number of libraries: libm.so, libpthread.so, libncurses.so, etc.

Jeffrey Fox

p. s. If you are using zgcc 2.02, then you are not correctly using zgcc.sh. Say
" . <pathto>/zgcc.sh" before compiling. Note the dot.
Hi Jeffrey,

I tried to contact you directly in the past to report a problem with the way libc is configured in zgcc but I think it may not have reached you. There are standard libc functions not implemented in the shared library, usually the ones a user will notice are the stat related functions. libc.so should not be a simple symbolic link to /lib/libc.so.6 but rather should be a file containing something like the following:
Code: [Select]
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
zgcc has worked beautifully for me on many many packages after installing libc_nonshared.a and making this change to the way zgcc was configured. I did run into this problem repeatedly when there was simply a symbolic link in place.

John

xfaethorx

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Gcc Cannot Find -lc
« Reply #4 on: September 13, 2005, 07:26:00 am »
Quote
Quote
The error is saying that it cannot find "libc.so" in the path specified by $LIBRARY_PATH. If you are compiling on the Zaurus, you need to create a symbolic link from /lib/libc.so.6 to <path>/libc.so where <path> is in $LIBRARY_PATH. This may have to be done for a number of libraries: libm.so, libpthread.so, libncurses.so, etc.

Jeffrey Fox

p. s. If you are using zgcc 2.02, then you are not correctly using zgcc.sh. Say
" . <pathto>/zgcc.sh" before compiling. Note the dot.
Hi Jeffrey,

I tried to contact you directly in the past to report a problem with the way libc is configured in zgcc but I think it may not have reached you. There are standard libc functions not implemented in the shared library, usually the ones a user will notice are the stat related functions. libc.so should not be a simple symbolic link to /lib/libc.so.6 but rather should be a file containing something like the following:
Code: [Select]
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
zgcc has worked beautifully for me on many many packages after installing libc_nonshared.a and making this change to the way zgcc was configured. I did run into this problem repeatedly when there was simply a symbolic link in place.

John
[div align=\"right\"][a href=\"index.php?act=findpost&pid=92717\"][{POST_SNAPBACK}][/a][/div]


i have a c3100 and i've encountered the same problem but I can't find libc_nonshared.a anywhere (its certainly not on the device or any feeds i've tried) ? can someone post it up? I'm runnin 2.95.2

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gcc Cannot Find -lc
« Reply #5 on: September 13, 2005, 08:29:20 am »
Quote
i have a c3100 and i've encountered the same problem but I can't find libc_nonshared.a anywhere (its certainly not on the device or any feeds i've tried) ? can someone post it up? I'm runnin 2.95.2
I use the one from the Embedix cross compiler. There are links here.

John

xfaethorx

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Gcc Cannot Find -lc
« Reply #6 on: September 14, 2005, 04:29:19 am »
alas all the links are fubar'ed on that page so I can't track it down. If anyone has a compatible 2.95.2 libc_nonshared then can post or get to me I'd appriciate it!

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gcc Cannot Find -lc
« Reply #7 on: September 14, 2005, 08:07:52 am »
Quote
alas all the links are fubar'ed on that page so I can't track it down. If anyone has a compatible 2.95.2 libc_nonshared then can post or get to me I'd appriciate it!
Sorry about that. The links on this Compiler Setup page work.

John