7 Comments

  1. Great article, solves me a problem trying to compile zabbix agent static (fatal error: ac_nonexistent.h: No such file or directory). Thank you!

  2. With cmake, to add the `-static` link option, you may use this piece of code in the CMakeLists.txt file:

    SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static" )

  3. I keep forgetting and remembering linking statically most of the time since I switch between vs and mingw/gnu, but thanks to your explanation finally I can keep tabs on these details. Thanks Eric for these very useful info!

Leave a Reply

Your email address will not be published. Required fields are marked *