Hi,
I can give you a Makefile which would build the DLL, but there are
certain problems with exported symbols when compiling examples:
- mysqlpp::Query - will ask for a destructor to be defined
- mysqlpp::Date - the same
- mysqlpp::Row - the same + constructor
I think for MINGW there should be added MYSQLPP_EXPORT in many places
(mysqlpp::Date(const_string&) is not exported anywhere but used in examples)
Please accept my apoligies for providing incomplete work, but I'm a
newbie to Windows stuff. I think the Makefile is usable (copy it in
mysql++/lib/Makefile). With ceratin work to sources now I think we could
get examples working too.
You need pexports.exe in PATH
(http://www.emmestech.com/software/cygwin/pexports-0.43/download_pexports.html)
Regards,
Ovidiu
Patrick McMichael wrote:
>Well there might be some way to generate the .a from the DLL, but I don't
>know it - you're already way beyond the farthest I ever got anyway.
>
>Good luck, and make sure to let us know once you get it working.
>
>-Patrick
>
>-----Original Message-----
>From: Death Gauge [mailto:clay_hg@stripped]
>Sent: Monday, November 21, 2005 8:31 AM
>To: p.s.mcmichael@stripped; plusplus@stripped
>Subject: RE: New Problem with DLL/MinGW
>
>Nope it just makes the DLL but not the '*.a' file that it is supposed to be
>making. I'm not giving up until I solve this problem and making MinGW
>version work with DLL again.
>
>--Death Gauge
>"How do you gauge your death?!"
>
>
>
>
>----Original Message Follows----
>From: "Patrick McMichael" <p.s.mcmichael@stripped>
>To: <plusplus@stripped>
>Subject: RE: New Problem with DLL/MinGW
>Date: Sun, 20 Nov 2005 23:57:10 -0500
>
>Is it building any .a?
>
>-----Original Message-----
>From: Death Gauge [mailto:clay_hg@stripped]
>Sent: Sunday, November 20, 2005 8:44 PM
>To: plusplus@stripped
>Subject: Re: New Problem with DLL/MinGW
>
>Oddly none of those ideas seem to work:(.
>
>
>
>--Death Gauge
>"How do you gauge your death?!"
>
>
>
>
>----Original Message Follows----
>From: Ovidiu Bivolaru <ovidiu@stripped>
>Reply-To: ovidiu@stripped
>CC: plusplus@stripped
>Subject: Re: New Problem with DLL/MinGW
>Date: Sun, 20 Nov 2005 22:16:52 +0200
>
>Actually, it is simple to override this . In mysq++/lib/Makefile, at line
>139 there is a rule which is targeting "examples" directory:
>$(RM) $(EX_BIN_DIR)*$(EXE). Is this correct ?
>Comment out this line (put # at begging of this line).
>
>Regards,
>Ovidiu
>
>Death Gauge wrote:
>
> >I did as you told me and I seem to get the mysqlpp.dll to compile but I
> >can't seem to get mysqlpp.a to compile at all. I get the following error
> >after adding the linker you recommend
> >
> >g++ -shared -o mysqlpp.dll --out-implib=mysqlpp.a debug/coldata.o
> >debug/connect
> >ion.o debug/datetime.o debug/field_names.o debug/field_types.o
> >debug/fields.o de
> >bug/manip.o debug/myset.o debug/qparms.o debug/query.o debug/result.o
> >debug/row.
> >o debug/sql_string.o debug/string_util.o debug/type_info.o debug/vallist.o
> >-Lc:
> >\mysql\lib\gcc -lmysqlclient
> >del /q "..\examples\debug\"*.exe
> >Could Not Find C:\mysql++\examples\debug\*.exe
> >make[1]: *** No rule to make target `mysqlpp.a', needed by `all'. Stop.
> >make[1]: Leaving directory `C:/mysql++/lib'
> >make: *** [all] Error 2
> >
> >--Death Gauge
> >"How do you gauge your death?!"
> >
> >----Original Message Follows----
> >From: "Patrick McMichael" <p.s.mcmichael@stripped>
> >To: "'MySQL++ Mailing List'" <plusplus@stripped>
> >Subject: RE: New Problem with DLL/MinGW
> >Date: Sat, 19 Nov 2005 21:50:19 -0500
> >
> >Death,
> >This error means it's not generating the import library for the
> >mysqlpp library (which is used in programs that use the DLL to let them
> >know
> >what's in the DLL, I think). You should be able to add the following flag
> >to your linker flags and it will build the import library for you as it
> >builds the dll.
> >
> >--out-implib=mysqlpp.a
> >
> >Please let us know if you get it working in MinGW with a DLL, we've all
> >tried and given up.
> >
> >-Patrick
> >
> >-----Original Message-----
> >From: Death Gauge [mailto:clay_hg@stripped]
> >Sent: Friday, November 18, 2005 12:06 AM
> >To: plusplus@stripped
> >Subject: New Problem with DLL/MinGW
> >
> >Well I seem to have compiled the DLL fine but then this pops up at the end
> >of the compilation.
> >
> >del /q "..\examples\debug\"*.exe
> >Could Not Find C:\mysql++\examples\debug\*.exe
> >make[1]: *** No rule to make target `mysqlpp.a', needed by `all'. Stop.
> >make[1]: Leaving directory `C:/mysql++/lib'
> >make: *** [all] Error 2
> >
> >Any ideas of what this means or how to fix it?
> >
> >--Death Gauge
> >"How do you gauge your death?!"
> >
> >_________________________________________________________________
> >On the road to retirement? Check out MSN Life Events for advice on how to
> >get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
> >
> >
> >--
> >MySQL++ Mailing List
> >For list archives: http://lists.mysql.com/plusplus
> >To unsubscribe:
> >http://lists.mysql.com/plusplus?unsub=1
> >
> >
> >
> >
> >--
> >MySQL++ Mailing List
> >For list archives: http://lists.mysql.com/plusplus
> >To unsubscribe: http://lists.mysql.com/plusplus?unsub=1
> >
> >_________________________________________________________________
> >Don't just search. Find. Check out the new MSN Search!
> >http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> >
> >
>
>
>--
>MySQL++ Mailing List
>For list archives: http://lists.mysql.com/plusplus
>To unsubscribe: http://lists.mysql.com/plusplus?unsub=1
>
>_________________________________________________________________
>On the road to retirement? Check out MSN Life Events for advice on how to
>get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>
>--
>MySQL++ Mailing List
>For list archives: http://lists.mysql.com/plusplus
>To unsubscribe:
>http://lists.mysql.com/plusplus?unsub=1
>
>
>
>
>--
>MySQL++ Mailing List
>For list archives: http://lists.mysql.com/plusplus
>To unsubscribe: http://lists.mysql.com/plusplus?unsub=1
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today - it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
>
>
>
## DO NOT EDIT. Created from Makefile.mingw and Makefile.base.
## Edit those files instead, then type 'makemake mingw' at the
## project root to rebuild this Makefile.
## This file contains the 'make' rules specific to MinGW GCC. 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
MYSQL_DIR=c:\mysql
CXX=g++
LIB_BASE=mysqlpp
BIN_DIR=debug
EX_BIN_DIR="..\examples\$(BIN_DIR)\"
## Build DLL -- uncomment $(IMP_FILE) target below, and comment out
## static library stuff if you want to try this.
CXXFLAGS=-W -Wall -Ic:\mysql\include -I.. -DMYSQLPP_MAKING_DLL -fkeep-inline-functions -c
IMP_FILE=$(BIN_DIR)/lib$(LIB_BASE).a
LIB_FILE=$(BIN_DIR)/$(LIB_BASE).dll
DEF_FILE=$(BIN_DIR)/libmysqlpp.def
LD=$(CXX)
LDFLAGS=-shared -o $(LIB_FILE) -Wl,--out-implib,$(IMP_FILE) -Wl,--output-def,$(DEF_FILE)
-Wl,--enable-runtime-pseudo-reloc
LIBS=-Lc:\mysql\lib\gcc -lmysqlclient
## Build static library
#CXXFLAGS=-Ic:\mysql\include -I.. -DMYSQLPP_NO_DLL -O2 -c
#LIB_FILE=lib$(LIB_BASE).a
#LD=ar
#LDFLAGS=cru $(BIN_DIR)\$(LIB_FILE)
LOCAL_CLEAN=debug release
ifeq "$(BIN_DIR)" "debug"
CXXFLAGS += -O0
else
CXXFLAGS += -O2
endif
vpath %.a $(BIN_DIR)
vpath %.o $(BIN_DIR)
vpath %.dll $(BIN_DIR)
OBJ=o
EXE=.exe
DEL=rm -f
#RM=del /q
RM=rm -rf
CP=copy
.SUFFIXES: .cpp .o
.cpp.o:
$(CXX) $(CXXFLAGS) -o$(BIN_DIR)\$@ $<
mingw: all
example_setup:
#$(IMP_FILE): $(LIB_FILE)
# pexports $(LIB_FILE) |sed 's/^_//' > $(BIN_DIR)/$(LIB_BASE).def
# dlltool -d $(BIN_DIR)/$(LIB_BASE).def --driver-name c++ -l $(IMP_FILE)
## This is the base Makefile for compiling the MySQL++ library on
## systems that do not use automake. The ../makemake.* script appends
## this to one of the other Makefile.* files in this directory 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
# --- No user-serviceable parts below :)
OBJS= coldata.$(OBJ) \
connection.$(OBJ) \
datetime.$(OBJ) \
field_names.$(OBJ) \
field_types.$(OBJ) \
fields.$(OBJ) \
manip.$(OBJ) \
myset.$(OBJ) \
qparms.$(OBJ) \
query.$(OBJ) \
result.$(OBJ) \
row.$(OBJ) \
sql_string.$(OBJ) \
string_util.$(OBJ) \
type_info.$(OBJ) \
vallist.$(OBJ)
BIN_DIR_OBJS=$(addprefix $(BIN_DIR)/, $(OBJS))
all debug: $(OBJS) $(LIB_FILE) $(IMP_FILE)
.PHONY: release
release:
$(MAKE) BIN_DIR=release
clean:
$(RM) $(LOCAL_CLEAN)
$(LIB_FILE): $(OBJS)
$(LD) $(LDFLAGS) $(LDSTARTUP) $(BIN_DIR_OBJS) $(LDEXE) $(LIBS)
# $(RM) $(EX_BIN_DIR)*$(EXE)
coldata.$(OBJ): coldata.cpp coldata.h
connection.$(OBJ): connection.cpp connection.h
datetime.$(OBJ): datetime.cpp datetime.h
field_names.$(OBJ): field_names.cpp field_names.h
field_types.$(OBJ): field_types.cpp field_types.h
fields.$(OBJ): fields.cpp fields.h resiter.h
manip.$(OBJ): manip.cpp manip.h
myset.$(OBJ): myset.cpp myset.h
qparms.$(OBJ): qparms.cpp qparms.h
query.$(OBJ): query.cpp query.h resiter.h
result.$(OBJ): result.cpp result.h resiter.h
row.$(OBJ): row.cpp row.h resiter.h
sql_string.$(OBJ): sql_string.cpp sql_string.h
string_util.$(OBJ): string_util.cpp string_util.h
type_info.$(OBJ): type_info.cpp type_info.h
vallist.$(OBJ): vallist.cpp vallist.h