0
votes

C++ static library

I want to use my own static lib, which uses 3rd party libraries, in a C++ exe. Even if I include headers and libs of the 3rd party libraries in my exe, there are linking errors, because the 3rd party libraries are not found. What exactly do I have to do?

Thanks

2
What compiler? What system? Are the 3rd party libraries static or dynamic? - woolstar
What errors are you receiving? - 3Dave

2 Answers

0
votes

On most systems a static library is just a collection of object files, and not anything else. That means that all external references in the static library are unresolved. If you link with the static library you need to satisfy the linking needs of the library as well.

0
votes

The usual way is that the final linked binary resolves all the dependencies.

But under visual studio you can pack the 3rd party library into your own library, if you don't want your user to be forced to download and link it.

Librarian > General > Additional Dependencies