Skip to content

Instantly share code, notes, and snippets.

@soardex
Created May 26, 2015 08:23
Show Gist options
  • Save soardex/f7026f1f427662935dfa to your computer and use it in GitHub Desktop.
Save soardex/f7026f1f427662935dfa to your computer and use it in GitHub Desktop.
Building libraries using MinGW
# build library dll
g++ -c -DBUILDING_EXAMPLE_DLL example_dll.cpp
g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a
# build executable
g++ -c example_exe.cpp
g++ -o example_exe.exe example_exe.o -L. -lexample_dll
# build without an import library
g++ -o example_exe.exe example_exe.o example_dll.dll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment