mingw32.a中未定义的引用

时间:2013-11-13 01:13:26

标签: c++ mingw

在Fedora中使用mingw-w64时,我将此编译为动态库时遇到问题:

#include <windows.h>

extern int main(int argc, char* argv[]);

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
{
    return main(__argc, __argv);
}

我得到的链接错误是:

/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):(.text.startup+0x17)||undefined reference to `__mingw_winmain_nShowCmd'|
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):(.text.startup+0x28)||undefined reference to `__mingw_winmain_lpCmdLine'|
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):(.text.startup+0x31)||undefined reference to `__mingw_winmain_hInstance'|
||=== Build finished: 3 errors, 0 warnings ===|

0 个答案:

没有答案