Daniel
Daniel

Reputation: 1457

Detect unresolved symbols when linking my own static library due to forgotten source files

I've had problems when building a large static library that sometimes I've forgotten to add certain source files to the project. Since this is a static library there are no linker warnings until the end user, who is using a public API, is using a method that is calling one of these missing symbols. Is there any way to make sure all the "library local" symbols are resolved at linking time?

Upvotes: 0

Views: 106

Answers (1)

trojanfoe
trojanfoe

Reputation: 122458

As mentioned by @PeteBecker in the comments, this is about testing.

Create an executable that uses the static library and as long as it uses all the features you will catch missing objects very quickly, during link.

Make this executable test all the features and it doubles as your unit test facility as well.

Upvotes: 1

Related Questions