Created
May 26, 2015 08:23
-
-
Save soardex/f7026f1f427662935dfa to your computer and use it in GitHub Desktop.
Building libraries using MinGW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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