简体   繁体   中英

undefined reference to `__imp_*` when using mingw on linux

I'm trying to build libsigc++ 2.9.3 to use it to compile other software for windows using mingw on ubuntu and I'm getting a linker error when I try to make it:

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'
(...)

how do I fix this linker error, preferably without the need to fix the source code or makefiles?

This tells me you're missing some sort of standard library, but I don't know which. Given this is MinGW, I think you need to check the info on ./configure --help first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM