[libtorrent] Building libtorrent with Mingw 3.4.5 under vista
Brought to you by:
arvidn
|
From: Rohan D. <roh...@gm...> - 2007-11-30 20:49:33
|
Hello All, I just managed to build, after some trouble, (I'm also a n00b in the unix programming environment) libtorrent with 1. MinGW 3.4.5 2. Vista Home Premium Edition 3. boost_1_34_1 I am not sure if my libtorrent library is valid (yet to program and test ;-)) After following the directions at http://www.rasterbar.com/products/libtorrent/building.html section Step 2: Setup BBv2 i ran under cmd.exe bjam --toolset=gcc link=static and the output was *********************************************************************************** syntax error at EOF BOOST_ROOT = c:\boost_1_34_1 OS = NT Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (don't panic: this is a strictly optional feature). ...patience... ...found 1451 targets... ...updating 51 targets... gcc.compile.c++ bin\gcc-mingw-3.4.5\debug\dht-support-on\link-static\logging-none\threading-multi\closest_nodes.o In file included from include/libtorrent/asio/detail/socket_types.hpp:76, from include/libtorrent/asio/error.hpp:26, from include/libtorrent/asio/error_code.hpp:135, from include/libtorrent/asio/io_service.hpp:28, from include/libtorrent/asio/basic_io_object.hpp:20, from include/libtorrent/asio/basic_socket_acceptor.hpp:20, from include/libtorrent/asio/ip/tcp.hpp:20, from include/libtorrent/socket.hpp:48, from include/libtorrent/kademlia/node_entry.hpp:37, from include/libtorrent/kademlia/routing_table.hpp:51, from include/libtorrent/kademlia/traversal_algorithm.hpp:40, from include/libtorrent/kademlia/closest_nodes.hpp:38, from src\kademlia\closest_nodes.cpp:33: /mingw/include/ws2tcpip.h:16:2: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." In file included from include/libtorrent/asio/detail/socket_types.hpp:76, from include/libtorrent/asio/error.hpp:26, from include/libtorrent/asio/error_code.hpp:135, from include/libtorrent/asio/io_service.hpp:28, from include/libtorrent/asio/basic_io_object.hpp:20, from include/libtorrent/asio/basic_socket_acceptor.hpp:20, from include/libtorrent/asio/ip/tcp.hpp:20, from include/libtorrent/socket.hpp:48, from include/libtorrent/kademlia/node_entry.hpp:37, from include/libtorrent/kademlia/routing_table.hpp:51, from include/libtorrent/kademlia/traversal_algorithm.hpp:40, from include/libtorrent/kademlia/closest_nodes.hpp:38, from src\kademlia\closest_nodes.cpp:33: /mingw/include/ws2tcpip.h:124: error: redefinition of `struct ip_mreq' /mingw/include/winsock.h:278: error: previous definition of `struct ip_mreq' ... ... the list goes on... *********************************************************************************** ***Solution*** >From the jamfile, i noticed <toolset>msvc:<define>WIN32 # without WIN32_LEAN_AND_MEAN there will be conflicts between # winsock.h and winsock2.h <toolset>msvc:<define>WIN32_LEAN_AND_MEAN i learnt i thought maybe I having some missing defines so i changed the jamfile to basically by default define as a hack (since im running it under windows anyway) <define>WIN32 <define>WIN32_LEAN_AND_MEAN This successfully builds me a libtorrent library. I wonder why the defines were coupled to the toolset as opposed to the os? (Maybe its an exception under cygwin?) -gehaml1465- P.N. I'm really a complete n00b in most of the non_m$ technologies. so let me know if i make any glaring mistakes. ;-) |