Created
February 25, 2014 21:43
-
-
Save derrickturk/9218494 to your computer and use it in GitHub Desktop.
Dinking around with building windows DLLs with MinGW again. And figured out where the [[gnu::stdcall]] goes.
This file contains 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
g++ -std=c++11 -Wall -Wextra -c dlltest.cpp | |
g++ -shared -static-libgcc -static-libstdc++ -o dlltest.dll dlltest.o -Wl,--add-stdcall-alias |
This file contains 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
extern "C" { | |
[[gnu::dllexport]] int add [[gnu::stdcall]] (int x, int y) noexcept | |
{ | |
return x + y; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment