List:General Discussion« Previous MessageNext Message »
From:Miguel Cardenas Date:January 10 2009 3:22pm
Subject:VC++ 2008 / MySQL debug / Unhandled exception
View as plain text  
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:

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

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)

Debugging: YES /DEBUG

I based my configuration on this post for VC++ 6.0,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

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

VC++ 2008 / MySQL debug / Unhandled exceptionMiguel Cardenas10 Jan
  • Re: VC++ 2008 / MySQL debug / Unhandled exceptionsafknw11 Jan
    • RE: VC++ 2008 / MySQL debug / Unhandled exceptionMartin Gainty11 Jan
      • Re: VC++ 2008 / MySQL debug / Unhandled exceptionMiguel Cardenas14 Jan
  • Re: VC++ 2008 / MySQL debug / Unhandled exceptionPatrick Sherrill11 Jan
    • Re: VC++ 2008 / MySQL debug / Unhandled exceptionMiguel Cardenas14 Jan