Problem with static library linking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am having a problem with the static library as explained below.


There was an existing static library libpcap.a 
I created a new static library with the name mylib.a , mylib.a calls a function func() in libpcap.a.

I created mylib.a using the below command

ar rcs mylib.a *.o libpcap.a
ranlib mylib.a

mylib.a has been successfully made. 

But when I use mylib.a with an executable it says undefined symbol for the function func() in the file which is present in mylib.a.

I used the command "nm mylib.a | grep func" to verify that mylib.a actually contains func().

But still I am getting linking error.

In my link line  libpcap.a comes before mylib.a

Could you please help.

I would be very thankful.

-Harish



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux