dbTalk Databases Forums  

problems using mysql++ > 2.0.0

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss problems using mysql++ > 2.0.0 in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Werth
 
Posts: n/a

Default problems using mysql++ > 2.0.0 - 08-18-2005 , 04:11 AM






Hello,


I'm using mysql++ for a project in vc2003. Now h'm trying to switch to
new lib version.
I managed to compile mysqlpp lib using makefiles.
When using makefiles i notice 2 things.

First when running "makemake.bat vc" i get an error "make.bat not found".
When looking into makemake.bat i discovered at end of file a "call
make.bat" whereas this make.bat isn't created in mysqlpp root dir nor is
it delivered in basic install. I'm just ignoring this

Second this is a harder problem.
Using mysqlpp as dll in release version of my project seem to run fine.
Unfortunately in debug it always crashes when a local var ( like Query )
is destructed. It throws an assertion using internal debug func
"_CrtIsValidHeapPointer".

When looking a Readme.vc at part "Using MySQL++ in Your Own Projects"

Debug settings are shown this way

<<
Under Linker::General add to "Additional Library
Directories": "c:\mysql\lib\debug, c:\mysql++\vc\lib" for
the Debug configuration. For the Release configuration,
make it "c:\mysql\lib\opt, c:\mysql++\lib"
Quote:
Unfortunately no vc subdir is created.
I set "INST_DIR=F:\dev\Projekte\cpp\mysql++\vc" in makefile.vc in lib
dir, but nothing is created neither dir nor any files in there.

What am i doing wrong ? How do i tell makefile to create a debug version
of lib ?

greets
Thomas Werth

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Thomas Werth
 
Posts: n/a

Default Re: problems using mysql++ > 2.0.0 - 08-18-2005 , 08:17 AM






No it is an local var. Here's code for more information

Code:
bool CMySqlConnector::executeSelect ( std::string sql, mysqlpp::Result &result, bool log ) //Achtung Mysql++ hat Speicherloch bei Query.store() in combination mit std::string { try { Query query = m_clConnection.query(); //Backslashes doublen replaceSubstring( &sql, "\\", "\\\\" ); //SQL statement an query weitergeben query << sql.c_str(); //ausführen result = query.store(); return true; } catch (std::exception &er) { //skipped } return false; }
When running in try block right after leaving with return debug assert
hits in .
I'm using this func in this way :
Result myResult;
executeSelect( "select * from example", myResult, true );


CJNoyesSW (AT) aol (DOT) com schrieb:
Quote:
Was the query constructed with new? The error is happening because the
pointer doesn't point to one of VC++'s heaps.

-----Original Message-----
From: Thomas Werth <thomas.werth (AT) vahle (DOT) de
To: MySQL++ Mailing List <plusplus (AT) lists (DOT) mysql.com
Sent: Thu, 18 Aug 2005 11:11:03 +0200
Subject: problems using mysql++ > 2.0.0

Hello,


I'm using mysql++ for a project in vc2003. Now h'm trying to switch to
new lib version.
I managed to compile mysqlpp lib using makefiles.
When using makefiles i notice 2 things.

First when running "makemake.bat vc" i get an error "make.bat not found".
When looking into makemake.bat i discovered at end of file a "call
make.bat" whereas this make.bat isn't created in mysqlpp root dir nor is
it delivered in basic install. I'm just ignoring this

Second this is a harder problem.
Using mysqlpp as dll in release version of my project seem to run fine.
Unfortunately in debug it always crashes when a local var ( like Query )
is destructed. It throws an assertion using internal debug func
"_CrtIsValidHeapPointer".

When looking a Readme.vc at part "Using MySQL++ in Your Own Projects"

Debug settings are shown this way


Under Linker::General add to "Additional Library
Directories": "c:\mysql\lib\debug, c:\mysql++\vc\lib" for
the Debug configuration. For the Release configuration,
make it "c:\mysql\lib\opt, c:\mysql++\lib"


Unfortunately no vc subdir is created.
I set "INST_DIR=F:\dev\Projekte\cpp\mysql++\vc" in makefile.vc in lib
dir, but nothing is created neither dir nor any files in there.

What am i doing wrong ? How do i tell makefile to create a debug version
of lib ?

greets
Thomas Werth

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu... aol (DOT) com

--
MFG
Thomas Werth

Tel.: 02307 / 704 - 366
---------------------------------------------------------------------

Paul Vahle GmbH & Co. KG URL : http://www.vahle.de
Westicker Strasse 52 D-59174 Kamen E-Mail : thomas.werth (AT) vahle (DOT) de
---------------------------------------------------------------------


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: problems using mysql++ > 2.0.0 - 08-18-2005 , 11:53 AM



Thomas Werth wrote:
Quote:
First when running "makemake.bat vc" i get an error "make.bat not found".
Sorry, make.bat was accidentally left out of the distribution.

Quote:
Using mysqlpp as dll in release version of my project seem to run fine.
Unfortunately in debug it always crashes when a local var ( like Query )
is destructed. It throws an assertion using internal debug func
"_CrtIsValidHeapPointer".
Please help me debug this. I don't use Visual C++ with MySQL++
personally (I have it here for other reasons), so there's a limit to how
much effort I'm willing to put into this myself.

Quote:
Unfortunately no vc subdir is created.
There are several errors in the makemake system when using cmd.exe. I
tested under a different command shell, and didn't realize that there
were so many differences between the two. I'll release v2.0.2 soon to
fix this and the make.bat problem.

Quote:
How do i tell makefile to create a debug version of lib ?
cl /?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: problems using mysql++ > 2.0.0 - 08-18-2005 , 12:07 PM



Thomas Werth wrote:
Quote:
Achtung Mysql++ hat Speicherloch bei Query.store()
in combination mit std::string
If I understand Google's translation, you are claiming that there is a
memory leak in Query.store() when using C++ strings?

Quote:
//Backslashes doublen
replaceSubstring( &sql, "\\", "\\\\" );
I believe MySQL++'s escape manipulator will do this for you.

Quote:
query << sql.c_str();
Why can't you say "query << sql" ? Is this where you see this memory leak?

Quote:
When running in try block right after leaving with return debug assert
hits in .
Try building a debug version of MySQL++. I believe all you need to do
is change the /M?? flag in lib/Makefile.vc and rebuild the library.
Then see if the problem still occurs when linking your debug program
against the debug version of MySQL++.

It may simply be that VC++'s memory debugger is losing track of the
Connection object, and seeing an error where none exists.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Thomas Werth
 
Posts: n/a

Default Re: problems using mysql++ > 2.0.0 - 08-19-2005 , 01:48 AM



--------------010800030300090306080800
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Hi Warren,

My described Bug was related to the way studio differs between executing
and debugging an application.
While execute works fine, in debug heap is specially tracked. So All
linked dll's need to be special debug dll's. Which in case of mysqlpp
was not given.
I figured out how to set up makefile.vc to produce a mysqlppd.lib and
mysqlppd.dll for use in debug version of linked app.

Here's snippelt, path need to be adapted :

CXXFLAGS=/IF:\dev\cpp\addins\mysql-4.1.10-win32\include /I"lib" /Od
/DWIN32 /D_LIB /D_MBCS /D_DEBUG /DMYSQLPP_MAKING_DLL /D_WINDLL /G7 \
/EHsc /nologo /MDd /c /ZI /TP
LDFLAGS=/OUT:$(LIB_FILE) /DLL /NOLOGO
"F:\dev\cpp\addins\mysql-4.1.10-win32\lib\debug\libmysqld.lib"
INST_DIR=F:\dev\Projekte\cpp\mysqlpp\vc


Still INST_DIR Var seems to be useless cause no "vc" is created ...

maybe you can include in next distribution some kind of my appended
makefile so users simply can rename between release and Debug makefiles
whereas release may stay as default.

greetings
tom

Warren Young schrieb:
Quote:
Thomas Werth wrote:

First when running "makemake.bat vc" i get an error "make.bat not found".


Sorry, make.bat was accidentally left out of the distribution.

Using mysqlpp as dll in release version of my project seem to run fine.
Unfortunately in debug it always crashes when a local var ( like Query )
is destructed. It throws an assertion using internal debug func
"_CrtIsValidHeapPointer".


Please help me debug this. I don't use Visual C++ with MySQL++
personally (I have it here for other reasons), so there's a limit to how
much effort I'm willing to put into this myself.

Unfortunately no vc subdir is created.


There are several errors in the makemake system when using cmd.exe. I
tested under a different command shell, and didn't realize that there
were so many differences between the two. I'll release v2.0.2 soon to
fix this and the make.bat problem.

How do i tell makefile to create a debug version of lib ?


cl /?

--
MFG
Thomas Werth

Tel.: 02307 / 704 - 366
---------------------------------------------------------------------

Paul Vahle GmbH & Co. KG URL : http://www.vahle.de
Westicker Strasse 52 D-59174 Kamen E-Mail : thomas.werth (AT) vahle (DOT) de
---------------------------------------------------------------------


--------------010800030300090306080800
Content-Type: text/plain;
name="Makefile.vc.debugDll"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Makefile.vc.debugDll"

## This file contains the 'make' rules specific to Visual C++. The
## ../makemake.bat script prepends this to Makefile.base to create a
## complete Makefile.

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with MySQL++; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA

CXX=cl
CXXFLAGS=/IF:\dev\cpp\addins\mysql-4.1.10-win32\include /I"lib" /Od /DWIN32 /D_LIB /D_MBCS /D_DEBUG /DMYSQLPP_MAKING_DLL /D_WINDLL /G7 \
/EHsc /nologo /MDd /c /ZI /TP

LIB_BASE=mysqlppd
LIB_FILE=$(LIB_BASE).dll
IMP_FILE=$(LIB_BASE).lib
LD=link
LDFLAGS=/OUT:$(LIB_FILE) /DLL /NOLOGO "F:\dev\cpp\addins\mysql-4.1.10-win32\lib\debug\libmysqld.lib"

EXTRA_CLEAN=$(IMP_FILE) *.ext

INST_DIR=F:\dev\Projekte\cpp\mysqlpp\vc
INST_INC_DIR=$(INST_DIR)\include
INST_LIB_DIR=$(INST_DIR)\lib

OBJ=obj
EXE=exe
DEL=del /q


..SUFFIXES: .cpp .obj
..cpp.obj:
$(CXX) $(CXXFLAGS) $<


vc: all

install_platform:
@if not exist $(INST_DIR) mkdir $(INST_DIR)
@if not exist $(INST_INC_DIR) mkdir $(INST_INC_DIR)
@if not exist $(INST_LIB_DIR) mkdir $(INST_LIB_DIR)
copy *.h "$(INST_INC_DIR)" > NUL
copy *.dll "$(INST_LIB_DIR)" > NUL
copy *.lib "$(INST_LIB_DIR)" > NUL



--------------010800030300090306080800
Content-Type: text/plain; charset=us-ascii


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw
--------------010800030300090306080800--


Reply With Quote
  #6  
Old   
Warren Young
 
Posts: n/a

Default Re: problems using mysql++ > 2.0.0 - 08-19-2005 , 04:14 PM



Thomas Werth wrote:
Quote:
I figured out how to set up makefile.vc to produce a mysqlppd.lib and
mysqlppd.dll for use in debug version of linked app.

Here's snippelt, path need to be adapted :
Thanks for sending that. Next time, please send it in diff format as
described in the HACKERS file that comes with the MySQL++ tarball.

Quote:
Still INST_DIR Var seems to be useless cause no "vc" is created ...
Did you say "make install"? I tested that here before releasing 2.0.2,
and it worked for me.

Quote:
maybe you can include in next distribution some kind of my appended
makefile so users simply can rename between release and Debug makefiles
whereas release may stay as default.
I doubt that I will use your patch as-is. I want to make it easy to get
both a debug and a release version with a single "make" command, with
the output files (*.obj, *.dll...) separated out in subdirectories like
the VC++ IDE does.

Your patch will still help, though, because I need the proper build flags.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.