Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql++ bizarre example problem

Status
Not open for further replies.

lekaer

Programmer
Jun 12, 2009
6
NO
Im sure some of you have experience with mySQL++, and all im doing now is trying to get things to work.

This one is a bit of a headtwister for me:

I've built, installed, baked, tested and and made love to mysql++ files. Everything seems to be working: When i run (i.e) simple1.exe from cmd this way: C:\mysql++-3.0.9\vc2008\Debug>simple1.exe -u root -p mommy
it works like a screwdriver, and outputs:

We have:
Nurnberger
Pickle Relis
Hot Mustard
Hotdog Buns

When i open the simple1.cpp and rebuild it with
Code:
const char* db = "mysql_cpp_data", *server = "localhost", *user = "root", *pass = "mommy";
i get the same output, as expected.

BUT, when i create a new project, copy/pasting simple1.cpp, printdata.cpp, printdata.h, cmdline.cpp, cmdline.h into my source- and headerfiles folders, and build the cake, the output becomes:

We have:
*Supercrash with following errormsg*:
Code:
"Microsoft Visual Studio C Runtime Library has detected a fatal error in simple1.exe.
Press Break to debug the program or Continue to terminate the program."


So i press break:
Code:
".... 
lot of dll's loaded 
...
Microsoft Visual Studio C Runtime Library has detected a fatal error in simple1.exe."
And a breakpoint is placed at the line " for (it = res.begin(); it != res.end(); ++it) .... "


So it seems like it cant loop through the database.

I have reinstalled, rebuilt etc several times, but this happens each time. Im using winXP, VS 2008, mysql server 5.0

Any suggestions?

Help would be greatly appreciated!
 
So what's your question?

It's not like we can give you an answer, since there is no way to extrapolate what YOU did based on ONE line of variables.

Use the debugger, put a breakpoint at the start of the function which contains the fault line.
Then start single stepping your way towards the fault line.

Examine variables, results (especially results of functions you're ignoring) as you go, and try to figure out where it is going wrong.



--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Well, I thought maybe someone had struggled with the same problem during some point in time, and found a solution and would share it with me :)

The program builds and runs perfectly in Release, but not in Debug btw. Linker settings is the exact same for Release and Debug.

Since im a newbie, this may be a common problem/issue without me having heard of it before. Thats what i hoped for anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top