MinGW-W64链接器在搜索第三方静态库时跳过不兼容的文件

时间:2015-06-17 08:49:07

标签: c++ windows linker g++ mingw-w64

我使用的是Windows 7 64位,我正在使用MinGW-W64的g ++进行编译。

我正在尝试编译我在Unix计算机上编写的应用程序。但是,当我尝试链接某些第三方lib<name>.lib文件时,我遇到了问题。具体来说,我需要链接到ROOT库。链接器会发出错误,例如

C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibGui

我完全不知道该怎么做。我已尝试在各种不同的配置中多次重新安装MinGW-W64,摆弄我的-L和-l标签,重命名库,明确写出完整路径等等。我可以得到不同的错误,但它总是会出错。

我正在使用下面的批处理文件进行编译。

@echo off

set g++=C:\Users\jroth\Data\nest3\mingw64\bin\g++

set rootconfig=-pthread -m64 -IC:/root/root_v5.34.28/include -LC:/root/root_v5.34.28/lib -llibGui -llibCore -llibCint -llibRIO -llibNet -llibHist -llibGraf -llibGraf3D -llibGpad -llibTree -llibRint -llibPostscript -llibMatrix -llibPhysics -llibMathCore -llibThread -pthread -lm -ldl

%g++% -std=c++0x -Wall -o online_monitor.exe main.cpp external_input.o periodic_dinger.o flagger.o monitor.o %rootconfig%

运行它的结果是

C:\Users\jroth\Data\online_monitor v.0.5>make.bat
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libGui.lib when searching for -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibGui
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libCore.lib when searching for -llibCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libCore.lib when searching fmr -llibCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libCore.lib when searching for -llibCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libCint.lib when searching for -llibCint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libCint.lib when searching for -llibCint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libCint.lib when searching for -llibCint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibCint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libRIO.lib when searching for -llibRIO
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libRIO.lib when searching for -llibRIO
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libRIO.lib when searching for -llibRIO
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibRIO
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libNet.lib when searching for -llibNet
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libNet.lib when searching for -llibNet
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libNet.lib when searching for -llibNet
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibNet
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libHist.lib when searching for -llibHist
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libHist.lib when searching for -llibHist
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libHist.lib when searching for -llibHist
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibHist
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGraf.lib when searching for -llibGraf
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGraf.lib when searching for -llibGraf
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libGraf.lib when searching for -llibGraf
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibGraf
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGraf3D.lib when searching for -llibGraf3D
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGraf3D.lib when searching for -llibGraf3D
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libGraf3D.lib when searching for -llibGraf3D
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibGraf3D
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGpad.lib when searching for -llibGpad
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libGpad.lib when searching for -llibGpad
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libGpad.lib when searching for -llibGpad
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibGpad
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libTree.lib when searching for -llibTree
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libTree.lib when searching for -llibTree
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libTree.lib when searching for -llibTree
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibTree
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libRint.lib when searching for -llibRint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libRint.lib when searching for -llibRint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libRint.lib when searching for -llibRint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibRint
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libPostscript.lib when searching for -llibPostscript
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libPostscript.lib when searching for -llibPostscript
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libPostscript.lib when searching for -llibPostscript
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibPostscript
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libMatrix.lib when searching for -llibMatrix
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libMatrix.lib when searching for -llibMatrix
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libMatrix.lib when searching for -llibMatrix
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibMatrix
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libPhysics.lib when searching for -llibPhysics
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libPhysics.lib when searching for -llibPhysics
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libPhysics.lib when searching for -llibPhysics
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibPhysics
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libMathCore.lib when searching for -llibMathCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libMathCore.lib when searching for -llibMathCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libMathCore.lib when searching for -llibMathCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibMathCore
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libThread.lib when searching for -llibThread
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib/libThread.lib when searching for -llibThread
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/root/root_v5.34.28
/lib\libThread.lib when searching for -llibThread
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibThread
C:/Users/jroth/Data/nest3/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../
../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl
collect2.exe: error: ld returned 1 exit status
C:\Users\jroth\Data\online_monitor v.0.5>

g++ -v的结果是

C:\Users\jroth\Data\online_monitor v.0.5>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/Users/jroth/Data/nest/mingw64/bin/../libexec/gcc/x86_64-w
64-mingw32/5.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-5.1.0/configure --host=x86_64-w64-mingw32 --bu
ild=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysr
oot=/c/mingw510/x86_64-510-posix-seh-rt_v4-rev0/mingw64 --with-gxx-include-dir=/
mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable
-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdc
xx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-
lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --
enable-version-specific-runtime-libs --disable-isl-version-check --disable-libst
dcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-
win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --
with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-z
lib --with-gmp=/c/mingw510/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/
c/mingw510/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw510/prereq
uisites/x86_64-w64-mingw32-static --with-isl=/c/mingw510/prerequisites/x86_64-w6
4-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 pr
oject' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe
 -I/c/mingw510/x86_64-510-posix-seh-rt_v4-rev0/mingw64/opt/include -I/c/mingw510
/prerequisites/x86_64-zlib-static/include -I/c/mingw510/prerequisites/x86_64-w64
-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw510/x86_64-510-posix-seh-
rt_v4-rev0/mingw64/opt/include -I/c/mingw510/prerequisites/x86_64-zlib-static/in
clude -I/c/mingw510/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= L
DFLAGS='-pipe -L/c/mingw510/x86_64-510-posix-seh-rt_v4-rev0/mingw64/opt/lib -L/c
/mingw510/prerequisites/x86_64-zlib-static/lib -L/c/mingw510/prerequisites/x86_6
4-w64-mingw32-static/lib '
Thread model: posix
gcc version 5.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

我在objdump.exe -x上运行libGui.lib并退出

libGui.dll:     file format pe-i386
--------- 0/0    276 Mar 25 09:43 2015 libGui.dll
architecture: i386, flags 0x0000003d:
HAS_RELOC, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x00000000

Characteristics 0x100
        32 bit words

Time/Date               Wed Mar 25 09:43:50 2015
Magic                   0000
MajorLinkerVersion      0
MinorLinkerVersion      0
SizeOfCode              00000000
SizeOfInitializedData   00000000
SizeOfUninitializedData 00000000
AddressOfEntryPoint     00000000
BaseOfCode              00000000
BaseOfData              00000000
ImageBase               00000000
SectionAlignment        00000000
FileAlignment           00000000
MajorOSystemVersion     0
MinorOSystemVersion     0
MajorImageVersion       0
MinorImageVersion       0
MajorSubsystemVersion   0
MinorSubsystemVersion   0
Win32Version            00000000
SizeOfImage             00000000
SizeOfHeaders           00000000
CheckSum                00000000
Subsystem               00000000        (unspecified)
DllCharacteristics      00000000
SizeOfStackReserve      00000000
SizeOfStackCommit       00000000
SizeOfHeapReserve       00000000
SizeOfHeapCommit        00000000
LoaderFlags             00000000
NumberOfRvaAndSizes     00000000

The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 00000000 00000000 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 CLR Runtime Header
Entry f 00000000 00000000 Reserved

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .debug$S      00000040  00000000  00000000  0000008c  2**0
                  CONTENTS, READONLY, DEBUGGING
  1 .idata$5      00000004  00000000  00000000  000000cc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  2 .idata$4      00000004  00000000  00000000  000000d0  2**2
                  CONTENTS, ALLOC, LOAD, DATA
SYMBOL TABLE:
[  0](sec -1)(fl 0x00)(ty   0)(scl   3) (nx 0) 0x00dd7725 @comp.id
[  1](sec  2)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 ⌂libGui_NULL_THUNK_DAT
A


BFD: C:\root\root_v5.34.28\lib\libGui.lib(libGui.dll): Recognised but unhandled
machine type (0x14c) in Import Library Format archive

我实际上有很多次这样的东西,我最后按下Ctrl-C,但无论如何。 。 。这让我觉得这些库是32位的。我认为这可能是一个问题,但我不确定如何解决它。在g ++上使用-m32选项会使其拒绝所有C ++标准库。

我认为这就是我的全部。 。 。如果有帮助的话,我会非常愿意提供更多信息,并且非常感谢您提供的帮助。

2 个答案:

答案 0 :(得分:4)

从objdump.exe转储的消息中,您需要链接的lib是32位,而gcc(x64)生成的* .o文件是64位,因此不兼容。我认为您需要安装MinGW 32位版本。

答案 1 :(得分:3)

问题很可能是用VC ++编译库,所以它们显然与GCC不兼容。他们使用微软的link.exe链接得很好。