Bonjour,

après moultes arrachages de cheveux... je n'arrive point à utiliser la librairie mysql++ dans mes projets.

J'ai installé les derniers:
C::B - C:\Program Files (x86)\CodeBlocks
mingw - C:\MinGW\
mysql server 5.6 - C:\Program Files\MySQL\MySQL Server 5.6
le dernier mysql connector - C:\Program Files (x86)\MySQL\Connector


J'ouvre le projet mysql++
-> si je le compile en DLL: pas de .a ni de .dll
-> si je le compile en static: j'ai un fichier .a
mais ...

-------------- Build: Debug in Master (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -L"C:\Program Files (x86)\CodeBlocks\MinGW\x86_64-w64-mingw32\lib" -LC:\MinGW\lib\gcc\mingw32\4.7.2 -o bin\Debug\Master.exe obj\Debug\Shared\Database\Database.o obj\Debug\Shared\Database\DatabaseStocks.o obj\Debug\Shared\Server.o obj\Debug\Shared\Sockets\Acceptor.o obj\Debug\Shared\Sockets\ClientSocket.o obj\Debug\Shared\Sockets\Impl\IpAddress.o obj\Debug\Shared\Sockets\Impl\PingPong.o obj\Debug\Shared\Sockets\Impl\Socket.o obj\Debug\Shared\Sockets\Networker.o obj\Debug\Shared\Sockets\Packets\Creator.o obj\Debug\Shared\Sockets\Packets\Packet.o obj\Debug\Shared\Sockets\Packets\Reader.o obj\Debug\Shared\Sockets\Packets\Writer.o obj\Debug\Shared\Sockets\Selector.o obj\Debug\Shared\Sockets\ServerSocket.o obj\Debug\Shared\Sockets\Session.o obj\Debug\Shared\stdext.o obj\Debug\Shared\thread.o obj\Debug\Master\main.o -s -lws2_32 -lmysql -lpthread -lmysqlpp_d



c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../libmysql.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)

De plus, en changeant un paramètre, regardez le résultat..

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
-------------- Build: Debug in Master (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\MinGW\lib\gcc\mingw32\4.7.2 -L"C:\Program Files\MySQL\MySQL Server 5.6\lib"  -o bin\Debug\Master.exe obj\Debug\Shared\Database\Database.o obj\Debug\Shared\Database\DatabaseStocks.o obj\Debug\Shared\Server.o obj\Debug\Shared\Sockets\Acceptor.o obj\Debug\Shared\Sockets\ClientSocket.o obj\Debug\Shared\Sockets\Impl\IpAddress.o obj\Debug\Shared\Sockets\Impl\PingPong.o obj\Debug\Shared\Sockets\Impl\Socket.o obj\Debug\Shared\Sockets\Networker.o obj\Debug\Shared\Sockets\Packets\Creator.o obj\Debug\Shared\Sockets\Packets\Packet.o obj\Debug\Shared\Sockets\Packets\Reader.o obj\Debug\Shared\Sockets\Packets\Writer.o obj\Debug\Shared\Sockets\Selector.o obj\Debug\Shared\Sockets\ServerSocket.o obj\Debug\Shared\Sockets\Session.o obj\Debug\Shared\stdext.o obj\Debug\Shared\thread.o obj\Debug\Master\main.o   -s  -lws2_32 -lpthread -lmysqlclient -lmysqlpp_d 


obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x3d): undefined reference to `_imp___ZN7mysqlpp10ConnectionC1Eb'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x81): undefined reference to `_imp___ZN7mysqlpp10Connection7connectEPKcS2_S2_S2_j'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0xb4): undefined reference to `_imp___ZNK7mysqlpp10Connection5errorEv'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x134): undefined reference to `_imp___ZN7mysqlpp10ConnectionD1Ev'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x18b): undefined reference to `_imp___ZN7mysqlpp10Connection5queryERKSs'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x1db): undefined reference to `_imp___ZN7mysqlpp10Connection5queryEPKc'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x47d): undefined reference to `_imp___ZTVN7mysqlpp5QueryE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x6a0): undefined reference to `_imp___ZN7mysqlpp10Connection5queryERKSs'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x6b3): undefined reference to `_imp___ZTVN7mysqlpp5QueryE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x6c2): undefined reference to `_imp___ZTVN7mysqlpp5QueryE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x82a): undefined reference to `_imp___ZTVN7mysqlpp18OptionalExceptionsE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x839): undefined reference to `_imp___ZTCN7mysqlpp5QueryE0_So'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x9ba): undefined reference to `_imp___ZTVN7mysqlpp9ExceptionE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text+0x9d3): undefined reference to `_imp___ZTVN7mysqlpp8BadQueryE'
obj\Debug\Shared\Database\Database.o:Database.cpp:(.text$_ZN7mysqlpp18OptionalExceptionsD1Ev[__ZN7mysqlpp18OptionalExceptionsD1Ev]+0xfffff429): undefined reference to `_imp___ZTVN7mysqlpp18OptionalExceptionsE'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: obj\Debug\Shared\Database\Database.o: bad reloc address 0x1 in section `.text$_ZN7mysqlpp18OptionalExceptionsD1Ev[__ZN7mysqlpp18OptionalExceptionsD1Ev]'
Quelqu'un aurait-il une idée?

merci,

nico