在linux上使用mingw时未定义的引用`__imp_ *`

时间:2016-10-05 14:51:20

标签: c++ linux windows gnu-make mingw-w64

我正在尝试构建libsigc ++ 2.9.3,使用它在ubuntu上使用mingw为windows编译其他软件,并且当我尝试制作时遇到链接器错误:

libtool: link: /usr/bin/x86_64-w64-mingw32-g++  -shared -nostdlib /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/../../../../x86_64-w64-mingw32/lib/crtbegin.o  .libs/signal_base.o .libs/trackable.o .libs/connection.o functors/.libs/slot_base.o adaptors/lambda/.libs/lambda.o    -L/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32 -L/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/../../../../x86_64-w64-mingw32/lib -lstdc++ -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/../../../../x86_64-w64-mingw32/lib/crtend.o  -g3 -gdwarf-2   -Wl,-soname -Wl,libsigc-2.0.so.0 -o .libs/libsigc-2.0.so.0.0.0
/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/../../../../x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-gs_support.o): In function `__security_init_cookie': /build/buildd/mingw-w64-4.0.2/build/x86_64-w64-mingw32-x86_64-w64-mingw32-crt/../../mingw-w64-crt/crt/gs_support.c:62: undefined reference to `__imp_GetSystemTimeAsFileTime'
/build/buildd/mingw-w64-4.0.2/build/x86_64-w64-mingw32-x86_64-w64-mingw32-crt/../../mingw-w64-crt/crt/gs_support.c:70: undefined reference to `__imp_GetCurrentProcessId'
(...)

如何修复此链接器错误,最好不需要修复源代码或makefile?

1 个答案:

答案 0 :(得分:0)

这告诉我你错过了某种标准库,但我不知道哪个。鉴于这是MinGW,我认为您需要先查看./configure --help上的信息。