How to remove non-API symbols from static library (.a/.lib)?

  abi, c++, gcc, visual-c++

I want to pack an external library into my static library binary. But I’m afraid of user also has a different version of this external library.

I want to remove non-API symbols from the final produced lib to prevent user linking
to unwanted symbols from my lib. Is there any way to achieve it with MSVC and GNU toolchain?

I also heard about a technique called Partial Linking for GNU LD, which seems to be suitable to me. But I can’t find any working examples for MSVC. Is it possible on MSVC?

Source: Windows Questions C++

LEAVE A COMMENT