Attached is a more maintainable version which also builds the examples and tests.
From: Burton, Alex (DET, Newcastle)
Sent: Monday, January 06, 2014 5:45 PM
Subject: scons build on windows
Below is a build script to build various versions of the mysqlpp dll on windows, I found
it easier to write this than get the visual studio project files to work.
I have been using mysqlpp for many years but the project files must be too old for the
current visual studio.
This build script works with SCons which i recommend. On linux I just use the distribution
version of mysqlpp so I don't have to build it but this script could be easily modified to
work on unix.
Please consider adding this script so that people can build mysqlpp easier on windows, or
update your build system to scons, or throw away in disgust if you like.
for build in ['Debug','Release']:
for arch in ['x86','amd64']:
env = Environment(HOST_ARCH='x86',TARGET_ARCH=arch)
if arch == 'x86':
env['CPPPATH'] = ['C:/Program Files (x86)/MySQL/Connector C
env['LIBS'] = ['C:/Program Files (x86)/MySQL/Connector C
env['CPPPATH'] = ['C:/Program Files/MySQL/Connector C 6.0.2/include']
env['LIBS'] = ['C:/Program Files/MySQL/Connector C
env['LIBS'] += ['WSock32']
if build == 'Debug':
env['CCFLAGS'] = [
# , '/Gm'
# , '/W2'
env["CPPDEFINES"] = ['_DEBUG','MYSQLPP_MAKING_DLL','_WIN32']
env['LINKFLAGS'] = [ '/DEBUG' , '/INCREMENTAL' ]
env['CCFLAGS'] = [
env["CPPDEFINES"] = ['MYSQLPP_MAKING_DLL','_WIN32']
env['LINKFLAGS'] += ['/RELEASE' , '/LTCG' , '/INCREMENTAL:NO' , '/NOLOGO']
buildDir = "lib/" + build + "_" + arch
srcpaths = [buildDir + "/" + os.path.basename(x) for x in glob.glob('lib/*.cpp')]
env.SharedLibrary(target=buildDir + "/mysqlpp",source=srcpaths)
Research Engineer - Solar Thermal - Energy Technology - CSIRO
+61 2 4960 6110
+61 416 594 752
Attachment: [application/zip] scons_mysql.zip scons_mysql.zip