[pgrouting-dev] Problems linking on mingw64 between boost, cgal and threads

Stephen Woodbridge woodbri at swoodbridge.com
Mon Mar 11 21:42:53 PDT 2013


Hi all,

I'm stuck at the moment trying to link the pgrouting driving directions 
module using mingw 64 bit. See the issues below. So if anyone has any 
thoughts on this it would be appreciated. I will check the current state 
of the files into my branch in the morning here (GMT-5) if you are setup 
to reproduce this. It is too late to do it with a clear head tonight. 
I'll also move it back to Linux and try again there as I have changed a 
lot of files.

Thanks,
   -Steve

I have followed Sanak's directions from:
https://github.com/sanak/pgrouting4w/blob/master/BUILD.mingw64

ISSUE 1:

I first installed boost_1_51.zip but ran into problems compiling so 
installed boost_1_46_1.zip as he suggested. I was able to bootstrap 1_51 
and get a bjam.exe without a problem. But I could not get 1_46_1 to 
bootstrap :(

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

c:\ming64\projects\boost_1_46_1>bootstrap.bat mingw
Building Boost.Jam build engine
'cl' is not recognized as an internal or external command,
operable program or batch file.

Failed to build Boost.Jam build engine.
Please consult bjam.log for furter diagnostics.

You can try to obtain a prebuilt binary from

    http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bjam.log in that case.

c:\ming64\projects\boost_1_46_1>

So I built 1_46_1 using the bjam.exe that I built in 1_51 and it seems 
to have worked ok, but maybe that is part of the problem.

ISSUE 2:

Is the follow mess from the linker

Scanning dependencies of target routing_dd
[ 80%] Building C object 
core/driving_distance/src/CMakeFiles/routing_dd.dir/alpha.c.obj
[ 86%] Building CXX object 
core/driving_distance/src/CMakeFiles/routing_dd.dir/alpha_drivedist.cpp.obj
In file included from 
c:/ming64/projects/pgx64/pg92/include/postgresql/server/pg_config_os.h:37:0,
                  from 
c:/ming64/projects/pgx64/pg92/include/postgresql/server/c.h:87,
                  from 
c:/ming64/projects/pgx64/pg92/include/postgresql/server/postgres.h:47,
                  from 
c:/ming64/projects/pgrouting/core/driving_distance/src/alpha.h:27,
                  from 
c:/ming64/projects/pgrouting/core/driving_distance/src/alpha_drivedist.cpp:46:
c:\ming64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../x86_64-w64-mingw32/include/winsock2.h:13:2: 
warning: #warning Please include winsock2.h before windows.h
[ 93%] Building CXX object 
core/driving_distance/src/CMakeFiles/routing_dd.dir/boost_drivedist.cpp.obj
[100%] Building C object 
core/driving_distance/src/CMakeFiles/routing_dd.dir/drivedist.c.obj
Linking CXX shared library ../../../lib/librouting_dd.dll
Creating library file: ../../../lib/librouting_dd.dll.a
c:/ming64/msys/local/lib/libboost_thread-mgw45-mt-1_46_1.a(thread.o): 
duplicate section 
`.data$_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorISt9bad_allocEEEE[vtable 
for 
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::bad_alloc> 
 >]' has different size
c:/ming64/msys/local/lib/libCGAL.a(all_files.cpp.obj):all_files.cpp:(.text+0xf898): 
undefined reference to  `boost::system::generic_category()'
c:/ming64/msys/local/lib/libCGAL.a(all_files.cpp.obj):all_files.cpp:(.text+0xf8a4): 
undefined reference to `boost::system::generic_category()'
c:/ming64/msys/local/lib/libCGAL.a(all_files.cpp.obj):all_files.cpp:(.text+0xf8b0): 
undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make[2]: *** [lib/librouting_dd.dll] Error 1
make[1]: *** [core/driving_distance/src/CMakeFiles/routing_dd.dir/all] 
Error 2
make: *** [all] Error 2


More information about the pgrouting-dev mailing list