0

If you would create a library with c, that depends on another library, say cURL, you would compile it to a static library like this:

clang myLibrary.c -lcurl -c
ar myLibrary.a myLibrary.o

But, if you were to include this library in your application, you would get an error because some functions were not found (the cURL ones).

Is there a way to include libraries (in this case cURL) in the library at compile time? I'm working on a linux machine

Dirk
  • 2,094
  • 3
  • 25
  • 28
  • 1
    See http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one – starrify Dec 27 '13 at 13:44
  • So, you basically just merge the dependencies with your own library? – Dirk Dec 27 '13 at 13:45
  • The true meaning of your "to include libraries" is actually merging those object files together into another object file, executable or a library. What else do you expect? – starrify Dec 27 '13 at 13:47

0 Answers0