Boost::Asio et code::blocks
Bonjour, voilà mon problème:
j'ai téléchargé Boost1.34 et BoostAsio, j'ai tout mis directement dans la racine:
http://img261.imageshack.us/img261/8724/temp01vo0.jpg
j'ai configuré Code::Blocks :
http://img261.imageshack.us/img261/5...mp02bn4.th.jpg http://img519.imageshack.us/img519/1...mp03pp2.th.jpg
j'ai ensuite tenté de compiler le code du tutorial sur le site de Boost::Asio :
tutorial : http://asio.sourceforge.net/boost_as...tuttimer1.html
Code complet :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| #include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
int main()
{
boost::asio::io_service io;
boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
t.wait();
std::cout << "Hello, world!\n";
return 0;
} |
voilà les insultes que le compiler m'envoie :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| C:/boost_asio_0_3_7/boost/asio/detail/socket_types.hpp:31:5: warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately
C:/boost_asio_0_3_7/boost/asio/detail/socket_types.hpp:32:5: warning: #warning Assuming _WIN32_WINNT=0x0500 (i.e. Windows 2000 target)
Linking console executable: bin\Release\test-01.exe
obj\Release\main.o:main.cpp:(.text+0xcde): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x6d): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x99): undefined reference to `WSASocketA@24'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xa7): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xf7): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x12d): undefined reference to `setsockopt@20'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x135): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x165): undefined reference to `inet_addr@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x19d): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x1bf): undefined reference to `bind@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x1cd): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x214): undefined reference to `getsockname@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x249): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x263): undefined reference to `listen@8'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x271): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x2b3): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x2e9): undefined reference to `WSASocketA@24'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x2f7): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x348): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x36a): undefined reference to `connect@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x378): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x3c3): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x3e0): undefined reference to `accept@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x3ee): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x447): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x46b): undefined reference to `ioctlsocket@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x479): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x49f): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x693): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x6a4): undefined reference to `closesocket@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x6ac): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x6fa): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x70b): undefined reference to `closesocket@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x713): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x766): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x777): undefined reference to `closesocket@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x77f): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0x7bc): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xbaa): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xc0f): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xc69): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xcf4): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xd2a): undefined reference to `setsockopt@20'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xd32): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xd70): undefined reference to `WSASetLastError@4'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xd94): undefined reference to `ioctlsocket@12'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xda2): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xdc8): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xe22): undefined reference to `WSAGetLastError@0'
obj\Release\main.o:main.cpp:(.text$_ZN5boost4asio6detail25socket_select_interrupterC1Ev[boost::asio::detail::socket_select_interrupter::socket_select_interrupter()]+0xead): undefined reference to `WSASetLastError@4'
Process terminated with status 1 (0 minutes, 29 seconds)
50 errors, 2 warnings |
si je ne dis pas de bétise (...) ce genre de msg indiquent que j'ai mal ou pas, linké quelque chose, mais je ne sais pas quoi.