List:MySQL++« Previous MessageNext Message »
From:Neil J Mackie Date:April 21 2005 1:48pm
Subject:Re: Compiling library in Windows
View as plain text  
First, thanks to Warren and ahnkle for their suggestions to download and 
install the platform SDK. Doing so provided the file windows.h.

Warren added
>> Generated Makefiles are un-debuggable.
And the VC++ IDE is opaque, difficult to use, and a printed version of the 
nmake documentation is impossible to find. That said we do what we have to. 
I find that editing the generated Makefiles (with great care) is often 
easier than doing the same job via the VC++ IDE.

>> On Windows, you'll be including the DLL with your program.  (Or you 
>> would, if building a DLL were possible
Are you saying that MySQL++ cannot currently be built as a DLL ?
If so, some advice on how it _should_ be built would be welcome to those 
trying to build on windows.

>> >>SURELY there is someone on this list who has the full VC++ 7.1 IDE
>> >>and can generate a Makefile or binary and make it available?
>> Can.  Won't.

So although you recommend the free VC++ 2003 command line only tools, trying 
to use them is pointless because there is no make file for MySQL++. Why then 
make the recommendation? The only other option is to purchase the VC++ IDE 
from Microsoft and use the supplied project file, but I prefer not to give 
my money to Microsoft. They waste too much of my time already, without 
having to pay them for doing so.


In order to answer the originator of this thread I include a makefile below 
for MySQL++ which has been adapted from a VC++ 6.0 generated makefile. Using 
it I have been able to use the command line only VC++ 2003 tools to build a 
MySQL++ library from the 'Visual C++ Toolkit 2003 Command Prompt' which is 
available from your menu once you install the toolkit.

Having said that I have not been able to successfully link using the 
library. It may be some time till I sort out the problems that seem to be 
caused by mixing debug/nodebug, static/dll, single/multi-threaded libraries 
from VC++ 6, VC++2003, VC++2005 express & XP SP2 SDK, which is why it is 
included here as a work in progress. A timely answer now may be more use 
than a perfect answer that is late. If I make progress I'll post an update.

Regards,
Neil (J Mackie)

----- start mysql++.mak -----
# NMAKE build file for MySQL++ adapted from a
# Microsoft Developer Studio Generated NMAKE File
# run using nmake /D /f "mysql++.mak" CFG="mysql++ - win32 release"
# or nmake /D /f "mysql++.mak" CFG="mysql++ - win32 debug"
!IF "$(CFG)" == ""
CFG=mysql++ - win32 debug
!MESSAGE No configuration specified. Defaulting to mysql++ - win32 debug.
!ENDIF

!IF "$(CFG)" != "mysql++ - win32 release" && "$(CFG)" != "mysql++ - win32 
debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mysql++.mak" CFG="mysql++ - win32 debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mysql++ - win32 release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysql++ - win32 debug" (based on "Win32 (x86) Static Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF

CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "mysql++ - win32 release"

OUTDIR=.\release
INTDIR=.\release\tmp
# Begin Custom Macros
OutDir=.\release
# End Custom Macros

!IF "$(RECURSE)" == "0"

ALL : "$(OUTDIR)\mysql++.lib"

!ELSE

ALL : "$(OUTDIR)\mysql++.lib"

!ENDIF

!IF "$(RECURSE)" == "1"
CLEAN :""
!ELSE
CLEAN :
!ENDIF
 -@erase "$(INTDIR)\coldata.obj"
 -@erase "$(INTDIR)\connection.obj"
 -@erase "$(INTDIR)\datetime.obj"
 -@erase "$(INTDIR)\field_names.obj"
 -@erase "$(INTDIR)\field_types.obj"
 -@erase "$(INTDIR)\fields.obj"
 -@erase "$(INTDIR)\manip.obj"
 -@erase "$(INTDIR)\myset.obj"
 -@erase "$(INTDIR)\query.obj"
 -@erase "$(INTDIR)\result.obj"
 -@erase "$(INTDIR)\row.obj"
 -@erase "$(INTDIR)\sql_query.obj"
 -@erase "$(INTDIR)\sql_string.obj"
 -@erase "$(INTDIR)\string_util.obj"
 -@erase "$(INTDIR)\type_info.obj"
 -@erase "$(INTDIR)\vallist.obj"
 -@erase "$(INTDIR)\vc60.idb"
 -@erase "$(OUTDIR)\mysql++.lib"

"$(OUTDIR)" :
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

"$(INTDIR)" :
    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"

CPP_PROJ=/nologo /G6 /Zp4 /MD /W3 /GR /GX /O2 /X /I "c:\Program 
Files\Microsoft Visual C++ Toolkit 2003\Include" /I "c:\Program 
Files\Microsoft Platform SDK for Windows XP SP2\Include" /I 
"c:\unix\MySQL\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D 
"_AFXDLL" /Fp"$(INTDIR)\TDB_class.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" 
/FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mysql++.bsc"
BSC32_SBRS= \

LIB32=link.exe -lib
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\mysql++.lib"
LIB32_OBJS= \
 "$(INTDIR)\coldata.obj" \
 "$(INTDIR)\connection.obj" \
 "$(INTDIR)\datetime.obj" \
 "$(INTDIR)\field_names.obj" \
 "$(INTDIR)\field_types.obj" \
 "$(INTDIR)\fields.obj" \
 "$(INTDIR)\manip.obj" \
 "$(INTDIR)\myset.obj" \
 "$(INTDIR)\query.obj" \
 "$(INTDIR)\result.obj" \
 "$(INTDIR)\row.obj" \
 "$(INTDIR)\sql_query.obj" \
 "$(INTDIR)\sql_string.obj" \
 "$(INTDIR)\string_util.obj" \
 "$(INTDIR)\type_info.obj" \
 "$(INTDIR)\vallist.obj"

"$(OUTDIR)\mysql++.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
    $(LIB32) @<<
  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
<<

!ELSEIF  "$(CFG)" == "mysql++ - win32 debug"

OUTDIR=.\debug
INTDIR=.\debug\tmp
# Begin Custom Macros
OutDir=.\debug
# End Custom Macros

!IF "$(RECURSE)" == "0"

ALL : "$(OUTDIR)\mysql++.lib"

!ELSE

ALL : "$(OUTDIR)\mysql++.lib"

!ENDIF

!IF "$(RECURSE)" == "1"
CLEAN :""
!ELSE
CLEAN :
!ENDIF
 -@erase "$(INTDIR)\coldata.obj"
 -@erase "$(INTDIR)\connection.obj"
 -@erase "$(INTDIR)\datetime.obj"
 -@erase "$(INTDIR)\field_names.obj"
 -@erase "$(INTDIR)\field_types.obj"
 -@erase "$(INTDIR)\fields.obj"
 -@erase "$(INTDIR)\manip.obj"
 -@erase "$(INTDIR)\myset.obj"
 -@erase "$(INTDIR)\query.obj"
 -@erase "$(INTDIR)\result.obj"
 -@erase "$(INTDIR)\row.obj"
 -@erase "$(INTDIR)\sql_query.obj"
 -@erase "$(INTDIR)\sql_string.obj"
 -@erase "$(INTDIR)\string_util.obj"
 -@erase "$(INTDIR)\type_info.obj"
 -@erase "$(INTDIR)\vallist.obj"
 -@erase "$(INTDIR)\vc60.idb"
 -@erase "$(INTDIR)\vc60.pdb"
 -@erase "$(OUTDIR)\mysql++.lib"

"$(OUTDIR)" :
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

"$(INTDIR)" :
    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"

CPP_PROJ=/nologo /G6 /Zp4 /MDd /W3 /Gm /GR /GX /ZI /Od /X /I "c:\Program 
Files\Microsoft Visual C++ Toolkit 2003\Include" /I "c:\Program 
Files\Microsoft Platform SDK for Windows XP SP2\Include" /I 
"c:\unix\MySQL\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" 
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\mysql++.bsc"
BSC32_SBRS= \

LIB32=link.exe -lib
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\mysql++.lib"
LIB32_OBJS= \
 "$(INTDIR)\coldata.obj" \
 "$(INTDIR)\connection.obj" \
 "$(INTDIR)\datetime.obj" \
 "$(INTDIR)\field_names.obj" \
 "$(INTDIR)\field_types.obj" \
 "$(INTDIR)\fields.obj" \
 "$(INTDIR)\manip.obj" \
 "$(INTDIR)\myset.obj" \
 "$(INTDIR)\query.obj" \
 "$(INTDIR)\result.obj" \
 "$(INTDIR)\row.obj" \
 "$(INTDIR)\sql_query.obj" \
 "$(INTDIR)\sql_string.obj" \
 "$(INTDIR)\string_util.obj" \
 "$(INTDIR)\type_info.obj" \
 "$(INTDIR)\vallist.obj"

"$(OUTDIR)\mysql++.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
    $(LIB32) @<<
  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
<<

!ENDIF

.c{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.o\<bj::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<

.c{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $<
<<


!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("mysql++.dep")
!INCLUDE "mysql++.dep"
!ELSE
!MESSAGE Warning: cannot find "mysql++.dep"
!ENDIF
!ENDIF


!IF "$(CFG)" == "mysql++ - win32 release" || "$(CFG)" == "mysql++ - win32 
debug"
SOURCE=.\lib\coldata.cpp

"$(INTDIR)\coldata.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\connection.cpp

"$(INTDIR)\connection.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\datetime.cpp

"$(INTDIR)\datetime.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\field_names.cpp

"$(INTDIR)\field_names.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\field_types.cpp

"$(INTDIR)\field_types.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\fields.cpp

"$(INTDIR)\fields.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\manip.cpp

"$(INTDIR)\manip.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\myset.cpp

"$(INTDIR)\myset.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\query.cpp

"$(INTDIR)\query.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\result.cpp

"$(INTDIR)\result.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\row.cpp

"$(INTDIR)\row.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\sql_query.cpp

"$(INTDIR)\sql_query.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\sql_string.cpp

"$(INTDIR)\sql_string.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\string_util.cpp

"$(INTDIR)\string_util.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\type_info.cpp

"$(INTDIR)\type_info.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=.\lib\vallist.cpp

"$(INTDIR)\vallist.obj" : $(SOURCE) "$(INTDIR)"
 $(CPP) $(CPP_PROJ) $(SOURCE)



!ENDIF

----- end  mysql++.mak ----- 

Thread
Compiling library in WindowsNicholas Watmough19 Apr
  • Re: Compiling library in WindowsWarren Young20 Apr
Re: Compiling library in WindowsNeil J Mackie20 Apr
  • Re: Compiling library in WindowsChris Frey20 Apr
  • Re: Compiling library in WindowsWarren Young20 Apr
  • Re: Compiling library in WindowsNeil J Mackie21 Apr
    • Re: Compiling library in WindowsWarren Young21 Apr
      • Re: Compiling library in WindowsZahroof Mohamed21 Apr
        • Re: Compiling library in WindowsWarren Young21 Apr
Re: Compiling library in WindowsAndrew Zhu22 Apr