CMake and Static Linking

I’ve managed to solve my problem by using the following: #Dynamic/Shared Libs … #Static start set_target_properties(icarus PROPERTIES LINK_SEARCH_START_STATIC 1) set_target_properties(icarus PROPERTIES LINK_SEARCH_END_STATIC 1) set(CMAKE_FIND_LIBRARY_SUFFIXES “.a”) #Static Libs … #Set Linker flags set(CMAKE_EXE_LINKER_FLAGS “-static-libgcc -static-libstdc++”) This works without passing a -static which creates other big issues, and can essentially mix static and dynamic libraries. As long … Read more

Is a statically linked executable faster than a dynamically linked executable?

Static linking produces a larger executable file than dynamic linking because it has to compile all of the library code directly into the executable. The benefit is a reduction in overhead from no longer having to call functions from a library, and anywhere from somewhat to noticeably faster load times. A dynamically linked executable will … Read more

Is there a way to determine which version of Visual Studio was used to compile a static library?

For release libraries, it’s unlikely that you could determine the version. For debug libraries, you can use dumpbin: dumpbin /rawdata:1 library.lib The assembly manifest should be at the beginning of the dump and will contain the version of the CRT the library requires along with the full path to the compiler used to build the … Read more

Making small haskell executables?

With the development branch of GHC (anyone know exactly which version this was added in?): $ ghc -o hello hello.hs $ strip -p –strip-unneeded –remove-section=.comment -o hello-small hello $ du hello hello-small 700 hello 476 hello-small Add the -dynamic flag for a dynamically linked RTS: $ ghc -dynamic -o hello hello.hs $ strip -p –strip-unneeded … Read more

techhipbettruvabetnorabahisbahis forumuedueduseduedueduseduseduseduedusedus