MinGW-W64 linker skipping incompatible files when searching for third-party static libraries

Jordan picture Jordan · Jun 17, 2015 · Viewed 12.5k times · Source

I'm on Windows 7 64-bit, and I'm compiling with g++ from MinGW-W64.

I'm trying to compile an application that I wrote on a Unix computer. I'm running into problems, however, when I try to link against certain third-party lib<name>.lib files. Specifically, I need to link to ROOT libraries. The linker spits out errors such as

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

I'm completely at a loss as to what to do. I've tried re-installing MinGW-W64 several times in various different configurations, fiddling with my -L and -l tags, renaming the libraries, writing out their full paths explicitely, etc. I can get the thing to yield different errors, but it always gives errors.

I'm compiling with the batch file below.

@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%

The result of running this is

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 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 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>

The result of g++ -v is

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)

I've run objdump.exe -x on libGui.lib and got out

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

I actually got things like this a whole bunch of times, and I eventually press Ctrl-C, but anyway . . . this makes me think that the libraries are 32-bit. I think that this might be a problem, but I'm not sure how to fix it. Using the -m32 option on g++ makes it reject all of the standard libraries for C++.

I think that that's about all I have . . . I would be very willing to provide more info if it would be helpful, and a great many thanks in advance for your help on this.

Answer

Fangqing Du picture Fangqing Du · Jan 10, 2017

From the message dumped from objdump.exe, the lib you need to link with is 32-bit, and the *.o files generated from the gcc (x64) is 64-bit, so is incompatible. I think you need to install MinGW 32-bit version.