Mc128k
Mc128k

Reputation: 25

How to embed a library in a C program?

I would like to embed the lib tar library inside my program, so if I run it from another computer that doesn't have libtar installed it runs correctly. Also this eliminates version issues.

I still know little about C. Is it possible? What are the best practices?

Thank you very much.

Upvotes: 1

Views: 189

Answers (2)

Rohan
Rohan

Reputation: 53386

You can have a static library and link your program with that library. That will embed the static library in your program so you won't need to have separately.

Upvotes: 2

user529758
user529758

Reputation:

You have to link your app with a static version of the library you're wanting to use.

Upvotes: 2

Related Questions