This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: "AR" problem
- From: Igor Korot <ikorot at earthlink dot net>
- To: binutils at sourceware dot org
- Cc: Ben Elliston <bje at au1 dot ibm dot com>
- Date: Wed, 13 Dec 2006 09:25:03 -0800 (GMT-08:00)
- Subject: Re: "AR" problem
- Reply-to: Igor Korot <ikorot at earthlink dot net>
Ben,
Thank you for the reply.
>-----Original Message-----
>>From: Ben Elliston <bje@au1.ibm.com>
>>Sent: Dec 11, 2006 6:44 PM
>>To: Igor Korot <ikorot@earthlink.net>
>>Cc: binutils@sourceware.org
>>Subject: Re: "AR" problem
>>
>>On Mon, 2006-12-11 at 21:17 -0500, Igor Korot wrote:
>>
>>> Now, in my app I have 2 statically linked .a library. One library (mylib1.a) depends on the other (mylib2.a). I was planning to link them together in one library using the KDevelop. However to my surprise, I found that the "ar" utility, that is used to generate the .a file/library does not work if the file is not located in the current directory. It is saying: "File not found".
>>
>>It's up to you to decide what goes into each of your archive libraries.
>>If it makes sense to put all of the code into one library, then do that.
>
Problem is: I don't know how smart the linker is?
My situation is following:
mylib1.a exports myclass1
mylib2.a exports myclass2
class2 is using some functions from class1.
At the same time I have a dynamically linked library "mydll.so", which has a class class3 declared as
class class3 : public class2
{
};
At the same time the class3 is using the functionality that is presented in class1.
Since I'm doing cross-development, on Windows using Visual Studio I can link ylib1.dll and mylib2.dll in one library
and then link mylib1.dll and mylib2.dll to mydll.dll.
However, it looks like on Linux I am having problems doing so.
That's why I have all these questions.
>
>>If not, keep them separate. When it comes time to link your final
>>application, include -lmylib1 -lmylib2 and link both to the final
>>executable. If there is a dependence between the two, you'll need to
>>determine the order that they're linked.
>
When I did such thing, the application crashed. I tried to put -mylib1 first, and put it second.
No difference.
And what about my second question: looking for the different directory than the current?
Is it going to be supported?
>
>>
>>Cheers, Ben
Igor.
>>