how to lunk application with non-standard extension based archieve file?

Submitted by amareshram
on November 7, 2007 - 5:23am

Hi,

I am trying to link my application (abc.c) with non-standard extension based archive (xyz.aXYZ) by using

gcc abc.c xyz.aXYZ

Linking fails with error message like undefined function reference.

But if I rename the archieve to standard one i.e. xyz.a, linking got successful.

This library is provided by 3d party and their application is able to link it.

can someone help me whether to resolve the issue?

regards/Amaresh

ln -s

strcmp
on
November 7, 2007 - 11:52pm

you can ln -s the archive with the correct extension into your work directory or a temporary directory, which you add to the link path with -L. this can be implemented with a simple makefile rule. also, as you found out, you can simply rename the file or ask said 3rd party to distribute the lib under a more useful name, e.g. using subdirectories instead of strange extensions.

Comment viewing options