User forums > Using Code::Blocks

ld.exe cannot find /usr/lib/libc.so.3.5

(1/3) > >>

eb:
I've found somewhat similar versions of this question but none of the answers seem to quite fit.

Build messages gives me these errors:
  ld.exe||cannot find /usr/lib/libc.so.3.5|
  ld.exe||cannot find /usr/lib/libcompat30.a|

However:
  Both files are located in C:\SFU\usr\lib
  C:\SFU\usr\lib\libcompat30.a is in my Link libraries list under Linker settings
  C:\SFU is in my list of Search directories for my Linker and my Resource compiler

Build log:

g++.exe -LC:\SFU  -o bin\Release\Rap00Unix.exe obj\Release\main.o   -s  C:\SFU\usr\lib\libcompat30.a C:\SFU\usr\lib\libc.so
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find /usr/lib/libc.so.3.5
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find /usr/lib/libcompat30.a
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 7 warnings

What is ld.exe?
Where is it looking for libc.so.3.5 and libcompat30.a?
How do I tell it where to look?

MortenMacFly:

--- Quote from: eb on January 31, 2012, 03:24:36 am ---What is ld.exe?
Where is it looking for libc.so.3.5 and libcompat30.a?
How do I tell it where to look?

--- End quote ---
That's the linker.
You need to add the libraries "libcompat30" and "libc" to the linker options. Then point to "C:\SFU\usr\lib\" for the linker include directories. However, I'm afraid it will not work, because the library "libc.so" looks pretty much like a Linux library to me which you can't use on Windows. So you'll need to re-compile your "SFU" (Whatever that is) for Windows. BTW: Usually you also don't need to link against libc.
Consult the C::B manual for the compiler/linker settings dialogs (see my signature).

eb:
ld.exe is the linker? Ok, but according to my Toolchain executables list g++ is the linker for my dynamic libs and ar.exe ...
Also (libc.so, libc.so.3.5 and libcompat30.a) come with Microsoft Services for Unix.

libc.so and libcompat30.c are already in my Link libraries list under Linker settings.

I added C:\SFU\usr\lib\ to my Linker Search directories (C:\SFU was already there).

I Rebuild workspace and I still get the same exact error in my Build log.

stahta01:
I will repeat myself, mixing libraries from different compilers does NOT work some of the time.
It can work if all the libraries involved are C libraries; but what you are doing is NOT a Code::Blocks related problem.
But, a programming problem that is more correct on a programming help site.

Tim S.

MortenMacFly:

--- Quote from: eb on January 31, 2012, 07:25:28 pm ---ld.exe is the linker?

--- End quote ---
Yes, it's invoked by the g++/gcc application you setup for the linker.

What makes you believe that "Microsoft Services for Unix" will work on Windows?

Navigation

[0] Message Index

[#] Next page

Go to full version