Compiling a static executable with CMake

As global CMake settings, add these lines before add_executable, valid for gcc/clang: set(CMAKE_FIND_LIBRARY_SUFFIXES “.a”) set(BUILD_SHARED_LIBS OFF) set(CMAKE_EXE_LINKER_FLAGS “-static”) On Modern CMake (3.x+ – target_link_libraries doc), you can apply the flag to specific targets, in this way: target_link_libraries(your_target_name -static) If you’re using MSVC, you have to set the compiler and linker flags: set(CMAKE_FIND_LIBRARY_SUFFIXES “.lib”) target_compile_options(your_target_name [PUBLIC|PRIVATE] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)