Question

I have a static library (.a file) that i can link fine with a main program using the following command line on Linux by placing the .a in the current folder and using an include with "" to prefer current folder for library location.

gcc userfile.c -L. -lnameoflib

However, i needed to integrate this pre-built library into an auto make file project. I have tried adding the userfile.c to the list of source files in Makefile.am. However, when make is ran, it fails to find references of functions called from the static lib i.e. .a

Upon some investigation it seems to be attempting to create a library with the name.a where as the library already exists and i just want script to use it.

The make file project is an existing well known open source project with standard bootstrap, configure, make and make install steps.

Would really appreciate any help.

Était-ce utile?

La solution

If you don't want this .a to be built by existing makefiles, just add LDADD = ./libsomething.a into Makefile.am and re-run automake && configure. – keltar

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top