Hello list

I have a problem debugging a program that uses MySQL. The program itself
does not have problems, it runs perfectly when run in the console (command
prompt), but if it is executed inside the Visual C++ 2008 debugger it causes
an error:

Unhandled exception at 0x004b1560 in MyProgram.exe: 0xC0000005: Access
violation reading location 0x00000000

when it reaches mysql_real_connect() I'm using "mysql-6.0.8-alpha-win32"
binary with setup.exe installer.

Note that I don't try to enter inside mysql functions, even if no
breakpoints are setup and I let the program to run freely it aborts there
with the unhandled exception.

My VC++ 2008 configuration is this:

------------------------------------------------------------------------
Includes:
C:\Program Files\MySQL\MySQL Server 6.0\include

Libraries:
C:\Program Files\MySQL\MySQL Server 6.0\lib\debug

Code generation:
Multi-threaded /MT

Precompiled headers: NO

Aditional dependencies:
wsock32.lib mysqlclient.lib libmysql.lib mysys.lib

Ignore specific library: (as found in a forum post)
LIBCMTD.lib

Debugging: YES /DEBUG
------------------------------------------------------------------------

I based my configuration on this post for VC++ 6.0
http://forums.mysql.com/read.php?45,49606,49606#msg-49606

I guess it may be due to the ignored LIBCMTD.lib (debug version of MT?), but
if don't ignore it the compilation fails at link time with lots of redefined
symbols.

My concrete question: is there something wrong with the configuration shown
in that post that I adapted to VC++ 2008? are VC++ programs with MySQL
unable to run inside VC++ debugger? I don't want to debut my MySQL code it
is working already for *NIX, but there are other parts of the program that
may require debug and it aborts when calling a mysql function.

Thanks for any comment or help

Reply via email to