Dear All,

I'm trying to upgrade VTK to 7.1.0. However the build fails, with an
undefined symbol error (see below). What startles me is that I can
find the symbol with 'nm' in a dll that is linked! And the order of
libs seems correct, the definition comes after the usage. Even if I
put the defining dll at the end, it does not help.

Here the details:

 /C/msys2/mingw64/bin/g++.exe  -v -march=x86-64 -mtune=generic -O2 -pipe
-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu++11  -mwin32 -mthreads
-O3 -DNDEBUG -pipe  -mthreads -shared -o ../../bin/libvtkCommonDataModel-7.1.dll
-Wl,--out-implib,../../lib/libvtkCommonDataModel-7.1.dll.a
-Wl,--major-image-version,1,--minor-image-version,0 -Wl,--whole-archive
CMakeFiles/vtkCommonDataModel.dir/objects.a -Wl,--no-whole-archive -lgdi32
-L../../bin/ -lvtkCommonTransforms-7.1 -lvtkCommonMisc-7.1 -lvtkCommonSystem-7.1
-lvtkCommonMath-7.1 -lvtksys-7.1 -lvtkCommonCore-7.1 -ltbb -lgdi32 -lws2_32
-lPsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32 -lvtkCommonCore-7.1

Using built-in specs.

COLLECT_GCC=C:\msys2\mingw64\bin\g++.exe

COLLECT_LTO_WRAPPER=C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/lto-wrapper.exe

Target: x86_64-w64-mingw32

Configured with: ../gcc-6.2.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64
--with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64
--with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld

Thread model: posix

gcc version 6.2.0 (Rev2, Built by MSYS2 project)

COMPILER_PATH=C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/;C:/msys2/mingw64/bin/../lib/gcc/;C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/

LIBRARY_PATH=C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/;C:/msys2/mingw64/bin/../lib/gcc/;C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../lib/;C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib/;C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../

COLLECT_GCC_OPTIONS='-v' '-march=x86-64' '-mtune=generic' '-O2' '-pipe' '-D'
'_FORTIFY_SOURCE=2' '-D' '__USE_MINGW_ANSI_STDIO=1' '-std=gnu++11' '-mwin32'
'-mthreads' '-O3' '-D' 'NDEBUG' '-pipe' '-mthreads' '-shared' '-o'
'../../bin/libvtkCommonDataModel-7.1.dll' '-L../../bin/' '-shared-libgcc'

 C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/collect2.exe -plugin
C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/liblto_plugin-0.dll
-plugin-opt=C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/lto-wrapper.exe
-plugin-opt=-fresolution=C:\msys2\tmp\cciPiEt8.res
-plugin-opt=-pass-through=-lmingwthrd -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lmingwthrd -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -m i386pep --shared -Bdynamic -e
DllMainCRTStartup --enable-auto-image-base -o
../../bin/libvtkCommonDataModel-7.1.dll
C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o
C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/crtbegin.o -L../../bin/
-LC:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0
-LC:/msys2/mingw64/bin/../lib/gcc
-LC:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib/../lib
-LC:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../lib
-LC:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib
-LC:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../.. --out-implib
../../lib/libvtkCommonDataModel-7.1.dll.a --major-image-version 1
--minor-image-version 0 --whole-archive
CMakeFiles/vtkCommonDataModel.dir/objects.a --no-whole-archive -lgdi32
-lvtkCommonTransforms-7.1 -lvtkCommonMisc-7.1 -lvtkCommonSystem-7.1
-lvtkCommonMath-7.1 -lvtksys-7.1 -lvtkCommonCore-7.1 -ltbb -lgdi32 -lws2_32
-lPsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32 -lvtkCommonCore-7.1 -lstdc++ -lmingwthrd -lmingw32
-lgcc_s --undefined=___deregister_frame_info --undefined=___register_frame_info
-lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32
-lkernel32 -lmingwthrd -lmingw32 -lgcc_s --undefined=___deregister_frame_info
--undefined=___register_frame_info -lgcc -lmoldname -lmingwex -lmsvcrt
C:/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/crtend.o

CMakeFiles/vtkCommonDataModel.dir/objects.a(vtkDataSetAttributes.cxx.obj):vtkDataSetAttributes.cxx:(.text+0x59a1):
undefined reference to `vtkAOSDataArrayTemplate<unsigned
char>::FastDownCast(vtkAbstractArray*)'

CMakeFiles/vtkCommonDataModel.dir/objects.a(vtkDataSetAttributes.cxx.obj):vtkDataSetAttributes.cxx:(.text+0x59b5):
undefined reference to `vtkAOSDataArrayTemplate<unsigned
char>::FastDownCast(vtkAbstractArray*)'

collect2.exe: error: ld returned 1 exit status


The symbol is defined in libvtkCommonCore-7.1.dll:
nm ../../bin/libvtkCommonCore-7.1.dll | c++filt | grep
'vtkAOSDataArrayTemplate<unsigned char>::FastDownCast(vtkAbstractArray.*)'

0000000066bd10e0 T vtkAOSDataArrayTemplate<unsigned
char>::FastDownCast(vtkAbstractArray*)



Am I missing something about linkage on Windows/MinGW?

Cheers,

    Mario Emmenlauer


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/

------------------------------------------------------------------------------
_______________________________________________
Msys2-users mailing list
Msys2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to