我有一个在 Linux 下编译没有错误的程序,但是当我使用 MinGW 为 Windows 编译它时,它无法运行,因为它说它旁边需要一些 DLL。所以我决定静态链接它,但它输出了一些错误:
/usr/i586-mingw32msvc/lib/libsfml-window-s.a(WindowImplWin32.o):WindowImplWin32.cpp:(.text+0x146e): undefined reference to `__Unwind_Resume'
/usr/i586-mingw32msvc/lib/libsfml-window-s.a(WindowImplWin32.o):WindowImplWin32.cpp:(.text+0x17d0): more undefined references to `__Unwind_Resume' follow
/usr/i586-mingw32msvc/lib/libsfml-window-s.a(WindowImplWin32.o):WindowImplWin32.cpp:(.eh_frame+0x12): undefined reference to `___gxx_personality_v0'
/usr/i586-mingw32msvc/lib/libsfml-window-s.a(Joystick.o):Joystick.cpp:(.eh_frame+0x11): undefined reference to `___gxx_personality_v0'
collect2: ld returned 1 exit status
似乎它有一些外部依赖项。那些是什么,我如何链接它们?
编辑:
这是我在命令行中输入的内容:
i586-mingw32msvc-g++ "./main.cpp" -o "./win32.exe" /usr/i586-mingw32msvc/lib/libsfml-graphics-sa /usr/i586-mingw32msvc/lib/libsfml-window-sa / usr/i586-mingw32msvc/lib/libm.a /usr/i586-mingw32msvc/lib/libmsvcr90.a
帮助将不胜感激。