User forums > Help
Problem with --enable-auto-import with mysql++
TDragon:
--- Quote from: Alexbad on June 03, 2006, 01:08:54 am ---You see, I don't know where I have to type the command "dlltool", I tried in a Ms-Dos Console, it didn't work...
--- End quote ---
You're definitely on the right track. A command prompt is the correct place to use those three commands, and probably the only thing getting in the way is that the system doesn't know how to implicitly find "dlltool" (dlltool.exe). The quickest way to correct this is to add the directory containing it to the path temporarily, right before you use the dlltool command:
set PATH=%PATH%;C:\CodeBlocks\bin
(or whatever directory MinGW is installed in).
Ceniza:
Trying to get the second code sample you provided compiled and linked wasn't straight/easy (even though it doesn't use mysql++ but just the plain mysql headers).
It uses old C++ style (needs some minor fixes), winsock.h really needs to be included before mysql.h, you have to set paths for includes and libraries, be sure two DLLs are in the PATH or in the same folder as your executable (MySQL suggests to add the path for one of those in the installation process), add two libraries in the correct order so it'll be able to link, ...
It won't be such a nice experience as you would want it to, but once you're done with all those details it should work lovely with Code::Blocks :)
Add to the previous installation procedure:
cd c:\mysql++
install.bat opt
Now you can create a new application (a new console application would be fine), change the main.cpp it created with a sample code that uses mysql++ and add this in Project->Build options:
[Linker: Link libraries]: mysqlpp, mysqlclient (add them in that order).
[Directories: Compiler]: C:\mysql++\include, C:\mysql\include (the order doesn't matter).
[Directories: Linker]: C:\mysql++\lib, C:\mysql\lib\opt (once again, the order doesn't matter).
Now you should be ready to hit build and almost get it to run (if c:\mysql++\lib is in the PATH or you copy c:\mysql++\lib\mysqlpp.dll to your executable's directory, it should run).
Just remember any mysql++ specific problem you better discuss it in the mysql++'s forums :)
Alexbad:
Sorry for the delay before my answer, I got problems with my mysql server (I was using EasyPHP, C/C++ includes don't come with easyphp :p) and I installed complete versions of the software.
I read your instructions, I finally got the libmysqlclient.a, I linked it and I get this from the linker :
Cannot find -lmysqlclient
And I didn't put any option in the linker options, I just add the .a library. Thanks for your precious help ;)
--- Quote from: Ceniza ---Just remember any mysql++ specific problem you better discuss it in the mysql++'s forums :)
--- End quote ---
You know, I'm used to speak french, I will not make on purpose to stay on english forums :lol:
Ceniza:
--- Quote from: Alexbad ---Cannot find -lmysqlclient
--- End quote ---
Could you check if libmysqlclient.a exists in C:\mysql\lib\opt? If it does, be sure that path is in [Directories: Linker], if not, search for it and add its path to [Directories: Linker].
Alexbad:
But I'm sure the path is okay because I used the function of Code::Blocks "Add library" :
You can see a print screen of my linker options : http://www.la-page.qc.ca/membres/mbr1/screencb.PNG
If someone feel able to resolve the problem, I can let him do it by giving him the control of my computer...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version