CDT Linking Problems [message #166959] |
Thu, 30 March 2006 08:39  |
Eclipse User |
|
|
|
Originally posted by: cabernet.obado.net
My configuration:
Fedora Core 5
Java: gij (GNU libgcj) version 4.1.0
Eclipse: 3.1.2 M20060118-1600
CDT: 3.0.2
I'm having some trouble executing my C++ managed make project... I've got
three different projects in the mix here:
1. Project A: Exectable (Gnu)
References Projects B and C
2. Project B: Shared Library (Gnu)
References Project C
3. Project C: Shared Library (Gnu)
Build order is B, C, A
When I do a rebuild all on project A, I don't get any errors or warnings,
but when I try to execute the binary I get the following error:
error while loading shared libraries: libC.so: cannot open shared object
file: No such file or directory
Okay, after much head banging, I run try running ldd on the exectable and
get:
libC.so => not found
libB.so => not found
It seems that there is some kind of linking problem, so I then did a
rebuild on project B only. I also got no errors, but when I ran ldd on the
binary libB.so I got:
libC.so => not found
Odd. I have the full paths to these libraries in my Library search path
under the C/C++ Build configuration, and the process definitely complains
if that path is not correct (I tried it).
Finally, I added the paths to the output binaries for projects B and C to
/etc/ld.so.conf and ran ldconfig. After that, my executables ran fine and
were able to resolve the shared libraries...
Shouldn't CDT automate this in some way? It seems odd that I would have to
go to these lengths to get shared libraries to work in a development
environment, but I am new to CDT. Am I missing something?
Thanks!
|
|
|
|
|
Re: CDT Linking Problems [message #167216 is a reply to message #166959] |
Mon, 03 April 2006 04:36   |
Eclipse User |
|
|
|
I suppose you need to set the LD_LIBRARY_PATH to the location(s) of your
shared libraries when you run the executable. You can do this in the
Environment Tab of the Launch Configuration.
I don't think that CDT managed make is expected to do this autmagically
for you.
HTH,
Toni
Chris Abernethy wrote:
> My configuration:
>
> Fedora Core 5
> Java: gij (GNU libgcj) version 4.1.0
> Eclipse: 3.1.2 M20060118-1600
> CDT: 3.0.2
>
> I'm having some trouble executing my C++ managed make project... I've
> got three different projects in the mix here:
>
> 1. Project A: Exectable (Gnu)
> References Projects B and C
>
> 2. Project B: Shared Library (Gnu)
> References Project C
>
> 3. Project C: Shared Library (Gnu)
>
> Build order is B, C, A
>
> When I do a rebuild all on project A, I don't get any errors or
> warnings, but when I try to execute the binary I get the following error:
>
> error while loading shared libraries: libC.so: cannot open shared object
> file: No such file or directory
>
> Okay, after much head banging, I run try running ldd on the exectable
> and get:
>
> libC.so => not found
> libB.so => not found
>
> It seems that there is some kind of linking problem, so I then did a
> rebuild on project B only. I also got no errors, but when I ran ldd on
> the binary libB.so I got:
>
> libC.so => not found
>
> Odd. I have the full paths to these libraries in my Library search path
> under the C/C++ Build configuration, and the process definitely
> complains if that path is not correct (I tried it).
>
> Finally, I added the paths to the output binaries for projects B and C
> to /etc/ld.so.conf and ran ldconfig. After that, my executables ran fine
> and were able to resolve the shared libraries...
>
> Shouldn't CDT automate this in some way? It seems odd that I would have
> to go to these lengths to get shared libraries to work in a development
> environment, but I am new to CDT. Am I missing something?
>
> Thanks!
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04754 seconds