I am trying to create static binary using CMake.
I looked around and found some non-descriptive solutions (for example, add the linker flag “-static”), but I'm not sure how to test them.
How do I know if there was a static insertion of a specific library (e.g. Threading) into my binary?
As the track says, use lddto get a list of dynamically linked libraries that your executable depends on, and make sure that the code you want to statically link is not .
ldd
nm strings , . grep , , , .
nm
strings
grep
, objdump, . .
objdump
, , , , , , . , .
CMake, UNIX, file , , , .
file
On Linux, you can also use a command lddthat shows in which libraries your binary references are dynamic.
Source: https://habr.com/ru/post/1790803/More articles:Entity Framework 4 and Code First CTP 5 - Missing Key - entity-frameworkСоединение MySQL таблицы с AVG() - mysqlPowershell: function interpolation - powershellhow xml-serialize array array in FSharp - f #What is the best way to learn Android for someone who has no programming experience? - androidNSInvocation: unrecognized selector even though it is installed - iosMissing MS Access depends on form value - ms-accessExit Tkinter video from GStreamer? - pythonLogic vector based on row membership - rRuby global variables, legal use - ruby | fooobar.comAll Articles