Bonjour a tous, je me retrouve devant un gros soucis pour simplement compiler avec boost.
Je suis sous Windows Seven 64 Bit professionel.
Voici la ligne qui pose soucis :
Oui une bête inclusion....
Code : Sélectionner tout - Visualiser dans une fenêtre à part #include <boost/asio.hpp>
Voici les log de mon Makefile :
puis voici mon makefile:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 g++ -g -D_WIN32_WINNT=0x0501 -o server obj/XMLAttribute.o obj/XMLNode.o obj/XMLTree.o obj/Client.o obj/EntryPoint.o obj/INetwork.o obj/InNetworkServer.o obj/OutNetworkServer.o obj/Persistant.o obj/Server.o obj/main.o -I./include/ -I./XML/ -L./lib -llibboost_system-vc90-mt-1_44 -llibboost_filesystem-vc90-mt-1_44 Info: resolving vtable for __cxxabiv1::__class_type_info by linking to __imp___ZTVN10__cxxabiv117__class_type_infoE (auto-import) Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import) Info: resolving vtable for __cxxabiv1::__si_class_type_info by linking to __imp___ZTVN10__cxxabiv120__si_class_type_infoE (auto-import) Info: resolving vtable for std::exception by linking to __imp___ZTVSt9exception (auto-import) c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs. obj/EntryPoint.o: In function `_static_initialization_and_destruction_0': d:\Babel\Server/./include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()' d:\Babel\Server/./include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()' d:\Babel\Server/./include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()' obj/EntryPoint.o:d:\Babel\Server/./include/boost/system/error_code.hpp:211: undefined reference to `boost::system::system_category()' obj/EntryPoint.o:d:\Babel\Server/./include/boost/asio/detail/impl/winsock_init.ipp:39: undefined reference to `WSAStartup@8' obj/EntryPoint.o:d:\Babel\Server/./include/boost/asio/detail/impl/winsock_init.ipp:48: undefined reference to `WSACleanup@0Info: resolving vtable for std::runtime_error by linking to __imp___ZTVSt13runtime_error (auto-import) Info: resolving vtable for __cxxabiv1::__vmi_class_type_info by linking to __imp___ZTVN10__cxxabiv121__vmi_class_type_infoE (auto-import) '
Je compile avec MinGW, je vous remercie de votre aide d'avance. J'ai beaucoup chercher sur google cette erreur semble commune, mais je n'ai toujours pas trouver de solution.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 CC = g++ CFLAGS = -g -D_WIN32_WINNT=0x0501 #-W -Wall -ansi -pedantic NAME = server SRC = $(wildcard src/*.cpp) SRC_XML = $(wildcard XML/*.cpp) OBJ = $(SRC:src/%.cpp=obj/%.o) OBJ_XML = $(SRC_XML:XML/%.cpp=obj/%.o) INCLUDE = -I./include/ -I./XML/ LIBS = -L./lib -llibboost_system-vc90-mt-1_44 \ -llibboost_filesystem-vc90-mt-1_44 all: $(OBJ_XML) $(OBJ) $(CC) $(CFLAGS) -o $(NAME) $^ $(INCLUDE) $(LIBS) obj/%.o: src/%.cpp $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE) $(LIBS) obj/%.o: XML/%.cpp $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE) $(LIBS) clean: rm -rf obj/*.o; rm -rf $(NAME);
EDIT:
Résolu, pour les suivant la solution : boost etait compiler avec Visual (toolset=msvc dans bjam) alors que je compile moi avec gcc en recompilant boost avec gcc (toolset=mgw45 ou gcc dans bjam) juste une erreur restante regler en ajoutant -lwsock32
Partager