Is it possible to compile c++ without any lib?
Because when i was trying to compile my program with Mingw and cygwin after the .exe file was made i couldn’t run it and it said there is a missing library. For cygwin it was “cygwin1.dll”.
Is it possible to compile c++ without any lib? Because when i was trying
Share
Binaries that are build with Cygwin always has dependency on
cygwin1.dll. Hovewer, if you want to avoid this, use linker option-mno-cygwin. This way you’ll make sure that there will be no dependency on cygwin runtime library that you need to ship with your app.MinGW has some local dependencies too. In particular,
libgcc_s_dw2-1.dll(depends on what unwinding type is used in your toolchain) andmingwm10.dll. To get rid of them, use-static-libgccand-mthreadsoptions for your linker. Please note that C++ exceptions depends on this option.Small note, however. Your question – “Is it possible to compile c++ without any lib?” is incorrect, since there are always some dependencies on libs (unless you are building binary for barebone hardware w/o OS), for example user32.dll for Windows. Sure, nor Cygwin nor MinGW is suitable for that.