Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
CODE::BLOCK, CYGWIN and MySql [SOLVED]
Hirogens:
Hi,
How to integrate MySQL (libmysql.a or libmysqlclient.a" to "CODE::BLOCK, CYGWIN" ?
all my test don't work....
B.Regards
Hirogens
ouch:
your going to have to be a bit more specific. What is your OS, C::B version and most importantly what is the actual error your getting.
Hirogens:
Scuse me,
OS : Seven
C::B version 10.05
CYGWIN (no MINWG)
I have find the library and Include of mysql on http://devpaks.org/
For me MySql 5.0.5
And I have some link error,
undefined reference to `_mysql_init'
undefined reference to `_mysql_real_connect'
undefined reference to `_mysql_error'
libmysql.a is in link line
g++-4.exe --enable-libgomp -lncurses -o Serveur.exe obj/Debug/main.o obj/Debug/Console.o -lgomp C:/cygwin/lib/libform.a C:/cygwin/lib/libmenu.a C:/cygwin/lib/libpanel.a C:/cygwin/lib/libncurses.a C:/cygwin/lib/mysql/libmysql.a -lmysql
B.Regards
reckless:
not related to C::B so expect this thread to be locked.
just a warning.
and in regards to mysql it is sometimes hard to get to work with mingw/cygwin (not impossible though) my guess is that the import library is broken.
put this in a bat file
call it reimp.bat
@echo off
for %%A in ("%1") do pexports %%A > tmp.def
for %%A in ("%1") do dlltool --dllname %%A --def tmp.def --output-lib lib%%A.a
make sure you have pexports.exe from mingw now run it in a windows prompt in the directory where libmysql.dll is like this reimp libmysql.dll
now you have a libmysql.a in the same dir move it to mingw/lib and try compiling again.
ofc remove the old import library and make sure you actually link against your new one.
oBFusCATed:
You get pretty much the standard answer: read the FAQ :)
This one: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
And this one: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F
hint: look in the GCC's manual, what -l and -L does...
Navigation
[0] Message Index
[#] Next page
Go to full version