Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22072

How to prohibit GCC from dropping unused function when linked static library?

$
0
0

I have an application linked with a few static libraries. And this application will load a dynamic library through dlopen. And the dynamic library will call a function which came from one of the static library.

I can only find the function in the static library throught "nm", whose label is "T". But I can't find it in the application.

I have tried -Wl,--whole-archive, but it seems that many "multiple definition" occur. Maybe because I can't add this flag only before the one static library.

So how to fix this issue?


Viewing all articles
Browse latest Browse all 22072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>