f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x16): undefined reference to `_encode_pointer'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x1d): undefined reference to `__onexitbegin'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x22): undefined reference to `__onexitend'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x87): undefined reference to `__native_startup_lock'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x90): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0xfa): undefined reference to `__native_startup_lock'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x105): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x113): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x120): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x181): undefined reference to `__onexitbegin'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x189): undefined reference to `_decode_pointer'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x194): undefined reference to `__onexitend'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x19c): undefined reference to `_decode_pointer'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x1c2): undefined reference to `__onexitend'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x1cc): undefined reference to `__onexitbegin'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x1d8): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x1e2): undefined reference to `__native_startup_lock'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x202): undefined reference to `__native_startup_lock'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x214): undefined reference to `__xi_z'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x21b): undefined reference to `__xi_a'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x221): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x248): undefined reference to `__xc_z'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x24f): undefined reference to `__xc_a'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x25a): undefined reference to `__native_startup_state'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x281): undefined reference to `__native_dllmain_reason'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x2b9): undefined reference to `__native_dllmain_reason'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x30c): undefined reference to `DllEntryPoint@12'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x340): undefined reference to `DllEntryPoint@12'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x3c2): undefined reference to `DllEntryPoint@12'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x415): undefined reference to `mingw_app_type'
f:/SAStudio_Win32_x86/env/g++/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x445): undefined reference to `__security_init_cookie'
CMakeFiles/poppler.dir/objects.a(gstrtod.cc.obj): In function `strtod':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `gmtime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:219: undefined reference to `_gmtime32'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `localtime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:217: undefined reference to `_localtime32'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `mktime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:218: undefined reference to `_mktime32'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `time':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:221: undefined reference to `_time32'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `mktime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:218: undefined reference to `_mktime32'
CMakeFiles/poppler.dir/objects.a(glibc.cc.obj): In function `difftime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:215: undefined reference to `_difftime32'
CMakeFiles/poppler.dir/objects.a(CharCodeToUnicode.cc.obj): In function `Z6sscanfPKcS0_z':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdio.h:231: undefined reference to `__mingw_vsscanf'
CMakeFiles/poppler.dir/objects.a(DateInfo.cc.obj): In function `sscanf':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdio.h:231: undefined reference to `__mingw_vsscanf'
CMakeFiles/poppler.dir/objects.a(DateInfo.cc.obj): In function `difftime':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:215: undefined reference to `_difftime32'
CMakeFiles/poppler.dir/objects.a(DateInfo.cc.obj): In function `time':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:221: undefined reference to `_time32'
CMakeFiles/poppler.dir/objects.a(Form.cc.obj): In function `strtod':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/stdlib.h:399: undefined reference to `__mingw_strtod'
CMakeFiles/poppler.dir/objects.a(PDFDoc.cc.obj): In function `time':
f:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/include/time.h:221: undefined reference to `_time32'
collect2.exe: error: ld returned 1 exit status
遇到此类调用标准库问题,基本全是指定路径不对和没有指定库名字的原因。
解决办法:
CMAKE中两个变量有问题:CMAKE_CXX_FLAGS 和 CMAKE_CXX_STANDARD_LIBRARY 进行设置。
CMAKE_CXX_FLAGS:设置 -L F:/SAStudio_Win32_x86/env/g++/i686-w64-mingw32/lib 进行路径指定。
CMAKE_CXX_STANDARD_LIBRARY:-liconv 指定库名字