Skip to content

Instantly share code, notes, and snippets.

@derrickturk
Created February 25, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derrickturk/9218494 to your computer and use it in GitHub Desktop.
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.
g++ -std=c++11 -Wall -Wextra -c dlltest.cpp
g++ -shared -static-libgcc -static-libstdc++ -o dlltest.dll dlltest.o -Wl,--add-stdcall-alias
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