CMake: how to produce binaries “as static as possible”

I did some investigation and although I could not find a satisfying solution to the problem, I did find a half-solution. The problem of static builds boils down to 3 things: Building and linking the project’s internal libraries. Pretty simple, one just has to flip the BUILD_SHARED_LIBS switch OFF. Finding static versions of external libraries. … Read more

how to do static linking of libwinpthread-1.dll in mingw?

If your toolchain includes the static winpthreads, adding the option -static Will pull in static versions of all libraries it can. Alternatively, you can remove libwinpthread.dll.a and the DLL itself from the toolchain directories. This might mess up programs linking with libstdc++ and libgcc DLLs though, so be careful. A third option is to use … Read more

Why does gcc not implicitly supply the -fPIC flag when compiling static libraries on x86_64

See question 3544035. Also discussed here and there. It depends on what use you will have for your static library. If you only want to link it into programs, it doesn’t need PIC code (libtool calls that a convenience library, because you could pretty much do without it, it simply helps get your compilation process … Read more

How to generate statically linked executables?

Since Rust 1.19, you can statically link the C runtime (CRT) to avoid this very common situation on Windows: The program can’t start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this problem. Add this to your .cargo/config file, using the appropriate target triple for your platform: [target.x86_64-pc-windows-msvc] rustflags = … Read more

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