程式語言 - MinGW - C/C++ - Console - Shared Library(DLL)



參考資訊:
http://www.winprog.org/tutorial/
http://winapi.freetechsecrets.com/win32/
https://github.com/gammasoft71/Examples_Win32
http://masm32.com/board/index.php?topic=3584.0
https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles

main.c

#include <stdio.h>

int test(const char *);

int main(int argc, char *argv[])
{
    test("test");
    return 0;
}

test.c

#include <stdio.h>

int test(const char *buf)
{
    printf("%s\n", buf);
    return 0;
}

編譯、執行

$ i686-w64-mingw32-gcc -mconsole -shared test.c -o test.dll
$ i686-w64-mingw32-gcc -mconsole main.c -o main.exe test.dll
$ wine ./main.exe
    test