Reputation: 20205
I have a C++ library containing several classes. Some of these classes are used explicitly by an executable and some are not. It seems clang and gcc strip classes not used explicitly from the executable.
How to prevent the compiler/linker from stripping specific symbols? Is there a pragma
something similar available.
Upvotes: 3
Views: 1548
Reputation: 66
For GCC try disabling DCE flags:
Upvotes: 1