boost + linux + mingw ( g++: unrecognized option `-pthread' , cannot find -lrt )

Hi. Has anyone compiled boost on linux+mingw ? I have Debian Etch, mingw32 mingw32-binutils mingw32-runtime installed. mingw binaries linked as so: (CHROOT-wine-386)root@kroko386:~/boost_1_33_1# find /usr/bin/ -type l -ls|grep 586 9601281 0 lrwxrwxrwx 1 root root 26 Nov 24 08:16 /usr/bin/gcc-3.4.5 -> i586-mingw32msvc-gcc-3.4.5 9601293 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/windres -> i586-mingw32msvc-windres 9601260 0 lrwxrwxrwx 1 root root 19 Nov 24 08:16 /usr/bin/cc -> i586-mingw32msvc-cc 9601282 0 lrwxrwxrwx 1 root root 23 Nov 24 08:16 /usr/bin/gccbug -> i586-mingw32msvc-gccbug 9601259 0 lrwxrwxrwx 1 root root 20 Nov 24 08:16 /usr/bin/c++ -> i586-mingw32msvc-c++ 9601275 0 lrwxrwxrwx 1 root root 20 Nov 24 08:14 /usr/bin/i586-mingw32msvc-cc -> i586-mingw32msvc-gcc 9601264 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/c++filt -> i586-mingw32msvc-c++filt 9601284 0 lrwxrwxrwx 1 root root 19 Nov 24 08:16 /usr/bin/ld -> i586-mingw32msvc-ld 9601290 0 lrwxrwxrwx 1 root root 21 Nov 24 08:16 /usr/bin/size -> i586-mingw32msvc-size 9601278 0 lrwxrwxrwx 1 root root 20 Nov 24 08:16 /usr/bin/gcc -> i586-mingw32msvc-gcc 9601292 0 lrwxrwxrwx 1 root root 22 Nov 24 08:16 /usr/bin/strip -> i586-mingw32msvc-strip 9601285 0 lrwxrwxrwx 1 root root 19 Nov 24 08:16 /usr/bin/nm -> i586-mingw32msvc-nm 9601286 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/objcopy -> i586-mingw32msvc-objcopy 9601283 0 lrwxrwxrwx 1 root root 21 Nov 24 08:16 /usr/bin/gcov -> i586-mingw32msvc-gcov 9601291 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/strings -> i586-mingw32msvc-strings 9601271 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/dllwrap -> i586-mingw32msvc-dllwrap 9601277 0 lrwxrwxrwx 1 root root 20 Nov 24 08:16 /usr/bin/g++ -> i586-mingw32msvc-g++ 9601287 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/objdump -> i586-mingw32msvc-objdump 9601258 0 lrwxrwxrwx 1 root root 19 Nov 24 08:16 /usr/bin/as -> i586-mingw32msvc-as 9601027 0 lrwxrwxrwx 1 root root 26 Nov 24 08:16 /usr/bin/addr2line -> i586-mingw32msvc-addr2line 9601265 0 lrwxrwxrwx 1 root root 20 Nov 24 08:16 /usr/bin/cpp -> i586-mingw32msvc-cpp 9601289 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/readelf -> i586-mingw32msvc-readelf 9601223 0 lrwxrwxrwx 1 root root 19 Nov 24 08:16 /usr/bin/ar -> i586-mingw32msvc-ar 9601266 0 lrwxrwxrwx 1 root root 24 Nov 24 08:16 /usr/bin/dlltool -> i586-mingw32msvc-dlltool 9601288 0 lrwxrwxrwx 1 root root 23 Nov 24 08:16 /usr/bin/ranlib -> i586-mingw32msvc-ranlib (CHROOT-wine-386)root@kroko386:~/boost_1_33_1# now I try to build with command: ~/bjam -sTOOLS=mingw -sGCC_INCLUDE_DIRECTORY=/usr/i586-mingw32msvc/include/ -sGCC_STDLIB_DIRECTORY=/usr/i586-mingw32msvc/lib/ --prefix=/opt/ gcc-C++-action bin/boost/libs/date_time/build/libboost_date_time.so/mingw/debug/shared-linkable-true/threading-multi/greg_month.o g++: unrecognized option `-pthread' /root/boost_1_33_1/libs/date_time/build/../src/gregorian/greg_month.cpp:1: warning: -fPIC ignored for target (all code is position independent) gcc-C++-action bin/boost/libs/date_time/build/libboost_date_time.so/mingw/debug/shared-linkable-true/threading-multi/greg_weekday.o g++: unrecognized option `-pthread' /root/boost_1_33_1/libs/date_time/build/../src/gregorian/greg_weekday.cpp:1: warning: -fPIC ignored for target (all code is position independent) gcc-C++-action bin/boost/libs/date_time/build/libboost_date_time.so/mingw/debug/shared-linkable-true/threading-multi/date_generators.o g++: unrecognized option `-pthread' /root/boost_1_33_1/libs/date_time/build/../src/gregorian/date_generators.cpp:1: warning: -fPIC ignored for target (all code is position independent) gcc-Link-action bin/boost/libs/date_time/build/libboost_date_time.so/mingw/debug/shared-linkable-true/threading-multi/libboost_date_time-mgw-mt-d-1_33_1.so g++: unrecognized option `-pthread' /usr/lib/gcc/i586-mingw32msvc/3.4.5/../../../../i586-mingw32msvc/bin/ld: cannot find -lrt collect2: ld returned 1 exit status What about those: 1) g++: unrecognized option `-pthread' 2) /usr/lib/gcc/i586-mingw32msvc/3.4.5/../../../../i586-mingw32msvc/bin/ld: cannot find -lrt collect2: ld returned 1 exit status Thanks..

hasn't anyone really at least tried to compile boost with linux+mingw ?

sfinks wrote:
hasn't anyone really at least tried to compile boost with linux+mingw ?
No. Why would one do that, since mingw is for Windows, not Linux? On linux we use the gcc/g++ provided with the distro. On Windows we use MSVC v7 & v8. My personal machine is setup for dual-boot (Windows on the first physical drive, various Linux distro's on the other physical drives). I've never tried mingw on Windows, but here is its definition from the MinGW home page: "A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs." I would expect nothing but trouble tyring to use mingw on non-Windows platforms. Larry

Larry Smith wrote:
sfinks wrote:
hasn't anyone really at least tried to compile boost with linux+mingw ?
No. Why would one do that, since mingw is for Windows, not Linux?
That's called cross-compiling. You compile binaries for windows on a linux distribution. That allows to not have to buy and install a proprietary system on your machine in order to make builds.

Mathias Gaunard wrote:
Larry Smith wrote:
sfinks wrote:
hasn't anyone really at least tried to compile boost with linux+mingw ? No. Why would one do that, since mingw is for Windows, not Linux?
That's called cross-compiling. You compile binaries for windows on a linux distribution. That allows to not have to buy and install a proprietary system on your machine in order to make builds.
Cross-compiling would be using a Linux GCC that's been specifically built to gen Windows code. The OP is trying to use the Windows version (Windows binaries) of mingw (via 'wine') on Linux, that will be problematic.

Larry Smith wrote:
Mathias Gaunard wrote:
Larry Smith wrote:
sfinks wrote:
hasn't anyone really at least tried to compile boost with linux+mingw ?
No. Why would one do that, since mingw is for Windows, not Linux?
That's called cross-compiling. You compile binaries for windows on a linux distribution. That allows to not have to buy and install a proprietary system on your machine in order to make builds.
Cross-compiling would be using a Linux GCC that's been specifically built to gen Windows code.
thats how it works.
The OP is trying to use the Windows version (Windows binaries) of mingw (via 'wine') on Linux, that will be problematic.
no. devel@kroko386:~$ file /usr/bin/i586-mingw32msvc-g* /usr/bin/i586-mingw32msvc-g++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped /usr/bin/i586-mingw32msvc-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped /usr/bin/i586-mingw32msvc-gcc-3.4.5: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped /usr/bin/i586-mingw32msvc-gccbug: Bourne shell script text executable /usr/bin/i586-mingw32msvc-gcov: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped devel@kroko386:~$ cat /etc/issue Debian GNU/Linux 4.0 \n \l devel@kroko386:~$

Larry Smith wrote:
sfinks wrote:
hasn't anyone really at least tried to compile boost with linux+mingw ?
No. Why would one do that, since mingw is for Windows, not Linux?
On linux we use the gcc/g++ provided with the distro.
On Windows we use MSVC v7 & v8. My personal machine is setup for dual-boot (Windows on the first physical drive, various Linux distro's on the other physical drives). I've never tried mingw on Windows, but here is its definition from the MinGW home page:
"A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs."
I would expect nothing but trouble tyring to use mingw on non-Windows platforms.
Larry
For example VLC ( http://www.videolan.org/vlc/ http://wiki.videolan.org/index.php/Win32Compile ) is officialy compiled with linux+mingw . wxWidgets ( wxMSW, http://www.wxwidgets.org/ ) compiles from out-of-the-box under mingw, and compiled examples all run ideally. So no trouble acctually ...

is there at least some boost developer who could confirm of disconfirm wheter boost Jamfiles has been made and/or tested for linux+mingw , or are boost's mingw supprot ONLY tested with windows mingw ? thanks..

sfinks wrote:
is there at least some boost developer who could confirm of disconfirm wheter boost Jamfiles has been made and/or tested for linux+mingw , or are boost's mingw supprot ONLY tested with windows mingw ?
I think you can take it that our Jamfiles were intended for Win32/Mingw. Personally I've never heard of mingw on anything else. However, assuming it behaves as "just another gcc" you should be able to use the gcc toolset. John.

I hope this helps
https://sourceforge.net/forum/message.php?msg_id=3470520
Parag
On 11/28/06, John Maddock
sfinks wrote:
is there at least some boost developer who could confirm of disconfirm wheter boost Jamfiles has been made and/or tested for linux+mingw , or are boost's mingw supprot ONLY tested with windows mingw ?
I think you can take it that our Jamfiles were intended for Win32/Mingw.
Personally I've never heard of mingw on anything else.
However, assuming it behaves as "just another gcc" you should be able to use the gcc toolset.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- "Civilization is the limitless multiplication of unnecessary necessities." -- Mark Twain
participants (5)
-
John Maddock
-
Larry Smith
-
Mathias Gaunard
-
Parag Gadkari
-
sfinks