Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Static Library
Static Library [message #143742] Wed, 20 April 2005 14:57 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.rocketcomp.com.au

This question was asked some time ago but I haven't seen any replies.

Has anyone worked out how to link in a static library in a multiple (managed)
project workspace ?

It always comes up with 'can't fine libXXXXX.a', even though the name and path
are setup ok in the C++ Builder options.
Re: Static Library [message #144104 is a reply to message #143742] Thu, 28 April 2005 01:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stefanm.uniblue.net

Ian Semmel wrote:

> This question was asked some time ago but I haven't seen any replies.

> Has anyone worked out how to link in a static library in a multiple
(managed)
> project workspace ?

> It always comes up with 'can't fine libXXXXX.a', even though the name and
path
> are setup ok in the C++ Builder options.

Yep, I have the same issue. If you heard any news let me know, will do
vice versa.

Stefan
Re: Static Library [message #144113 is a reply to message #144104] Thu, 28 April 2005 02:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stefanm.uniblue.net

Stefan Morrow wrote:

> Ian Semmel wrote:

>> This question was asked some time ago but I haven't seen any replies.
>> Has anyone worked out how to link in a static library in a multiple
> (managed)
>> project workspace ?

>> It always comes up with 'can't fine libXXXXX.a', even though the name and
> path
>> are setup ok in the C++ Builder options.

> Yep, I have the same issue. If you heard any news let me know, will do
> vice versa.

I have found the problem. As per GCC Linker doc. Check in the GCC
Documentation for the Linking Options and the 'l' setting. It states:

"...The only difference between using an '-l' option and specifying a file
name is that 'l' surrounds <library> with 'lib' and '.a' and searches
several directories."

In short this error occures if you simply reference a library object file
such as in my case: '-lC:/ACE_Wrappers/lib/libACE.dll.a'

This does not work as the linker will wrap that in :
lib'-lC:/ACE_Wrappers/lib/libACE.dll.a'.a
which does not exist. At least this is my theory as the following works:

Add the location of the library to the library search path in the project
build settings: "C/C++ Build" / "GCC C++ Linker" / "Libraries"

Then simpy specify the library file as library include. So if the link
object is libACE.dll.a then use ACE.dll

Try it.

Stefan
Re: Static Library [message #144377 is a reply to message #144113] Sun, 01 May 2005 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.rocketcomp.com.au

Stefan wrote:
> Stefan Morrow wrote:
>
>> Ian Semmel wrote:
>
>
>>> This question was asked some time ago but I haven't seen any replies.
>>> Has anyone worked out how to link in a static library in a multiple
>>
>> (managed)
>>
>>> project workspace ?
>
>
>>> It always comes up with 'can't fine libXXXXX.a', even though the name
>>> and
>>
>> path
>>
>>> are setup ok in the C++ Builder options.
>
>
>> Yep, I have the same issue. If you heard any news let me know, will do
>> vice versa.
>
>
> I have found the problem. As per GCC Linker doc. Check in the GCC
> Documentation for the Linking Options and the 'l' setting. It states:
>
> "...The only difference between using an '-l' option and specifying a
> file name is that 'l' surrounds <library> with 'lib' and '.a' and
> searches several directories."
>
> In short this error occures if you simply reference a library object
> file such as in my case: '-lC:/ACE_Wrappers/lib/libACE.dll.a'
>
> This does not work as the linker will wrap that in :
> lib'-lC:/ACE_Wrappers/lib/libACE.dll.a'.a
> which does not exist. At least this is my theory as the following works:
>
> Add the location of the library to the library search path in the
> project build settings: "C/C++ Build" / "GCC C++ Linker" / "Libraries"
>
> Then simpy specify the library file as library include. So if the link
> object is libACE.dll.a then use ACE.dll
>
> Try it.
>
> Stefan
>
>
This did the trick - thanks
Re: Static Library [message #762657 is a reply to message #144377] Thu, 08 December 2011 08:08 Go to previous messageGo to next message
Eclipse UserFriend
I know this is an old thread, but deals exactly with my problem.

The suggestion here helped me link a static library and compile my code. However, the functions from this library which I call are underlined in red with the message "Function XXX could not be resolved". How could I fix that?
Re: Static Library [message #768960 is a reply to message #762657] Wed, 21 December 2011 01:32 Go to previous messageGo to next message
Eclipse UserFriend
erickrfonseca wrote on Thu, 08 December 2011 21:08
The suggestion here helped me link a static library and compile my code. However, the functions from this library which I call are underlined in red with the message "Function XXX could not be resolved". How could I fix that?


I think the static analysis "codan", is not the best at navigating include paths. If it compiles and links fine, don't worry about it. If the error upsets you (like they do me), go to Window -> Preferences -> C/C++ -> Code Analysis and turn off the requisite option.
Re: Static Library [message #769038 is a reply to message #762657] Wed, 21 December 2011 04:40 Go to previous message
Eclipse UserFriend
erickrfonseca wrote on Thu, 08 December 2011 14:08
I know this is an old thread, but deals exactly with my problem.

The suggestion here helped me link a static library and compile my code. However, the functions from this library which I call are underlined in red with the message "Function XXX could not be resolved". How could I fix that?

- in your library project:
Project Properties->C/C++ General->Export Settings
In Tab Includes click "Add..." anklicken and add your main project (Workspace...)
- In your main project:
Project Properties->C/C++ General->Paths and Symbols
select the tab "References" and add your library project.
Previous Topic:CDT2.0M9: Cannot launch CDI debugger
Next Topic:Android SDK not Working in Eclipse
Goto Forum:
  


Current Time: Wed May 28 19:19:17 EDT 2025

Powered by FUDForum. Page generated in 0.04043 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top