File: README.vc

package info (click to toggle)
mysql++ 2.0.7-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,548 kB
  • ctags: 2,792
  • sloc: cpp: 35,566; sh: 8,517; xml: 2,769; perl: 752; makefile: 178
file content (146 lines) | stat: -rw-r--r-- 6,489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Compatibility
~~~~~~~~~~~~~
    MySQL++ only builds under Visual C++ 7.1 (a.k.a. Visual Studio
    2003, a.k.a. cl version 13.10) or later.  Earlier versions did
    not support a sufficiently broad set of the Standard C++ language.


About the New Build System (makemake)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    As of MySQL++ v2.0, we have changed the VC++ build system over to
    a command-line based system, instead of Visual Studio project
    files. We've done this for many reasons:

        1. Not everyone has the IDE: Microsoft has made their
           command-line tools available for free at various times,
           and these offers usually do not include the Visual
           Studio IDE.

        2. Project files tend to be tied to one version of
           Visual Studio.  Newer versions can migrate old project
           files, but then old versions cannot read the new files.
           So, each time there's a new version of Visual Studio,
           there's a transition period where at least two versions
           of the IDE are still in common use.  Makefiles,
           by contrast, work with all versions, without changes.

        3. Standardization: project files types proliferated
           in the old system, and we would frequently forget to
           update all of the project files when changing the
           corresponding autotools files.  In the new system,
           there are only two places where build system changes
           need to be made: one for systems using the autotools,
           and one for systems using makemake.

    So, please do not ask for the Visual Studio project files to
    return.  They cause more problems than they solve.


Prerequisite: GNU make
~~~~~~~~~~~~~~~~~~~~~~
	The Makefiles generated by makemake require GNU make.
	They used to work with Microsoft's nmake, but that held us
	back from adding several useful features.

	We've tested with two ports of GNU make for Windows: Cygwin and
	MinGW.

	To get GNU make through Cygwin, go to http://cygwin.com/ and
	get the Cygwin setup program.  GNU make isn't part of the
	default installation, so you will have to add it.  It's in
	the Devel category.

	To get the MinGW version of GNU make, go to http://mingw.org/
	and download it directly.  You shouldn't need to download
	anything but the GNU make package, as it should run standalone.

	Once you have done either of these, you will need to add
	the bin directory containing GNU make to your PATH.  If you
	don't know how to do this, open Windows Help and search for
	Environment Variables.


Building the Library and Example Programs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	First, you need to open a Windows command prompt (cmd.exe).
	The easiest way to do this is to go into your Visual Studio
	program group under the Start menu and in the Tools folder
	find the Command Prompt item.  All it does is open a command
	window and run a batch file called vcvars32.bat to set
	up the environment variables needed to run the Visual C++
	command-line tools.  If you have a different way to open a
	command prompt that you prefer, you can use that and run the
	vcvars32.bat file by hand.

    To create the Makefiles, say "makemake vc" in the project's root
    directory.  You only have to do this once, unless you change
    Makefile.base or Makefile.vc.

	Now you can run GNU make to build the library and examples.
	If you've installed GNU make through Cygwin, the command is
	"make".  If you're using the MinGW version of GNU make, it's
	"mingw32-make" instead.

    The build process creates debug and release versions of the MySQL++
    DLL, as well as import libraries for those DLLs.  It's possible to
    create a static library, but we don't do this in the distributed
    Makefiles because linking to such a library is a license violation
    for programs not licensed under the GPL or LGPL.  Using the
    library in DLL form avoids this problem.

    The build process also builds the example programs.  They are built
    in debug mode.  You should run the major examples to make sure
    the library is built correctly; see examples/README details.

    Once the library is built and you're satisfied that it's working
    correctly, say "make install" at the project root.  By default,
    it installs the library files and headers in subdirectories
    under c:\mysql++.

    If you didn't install MySQL in c:\mysql, you will have to change
    Makefile.vc in the lib and examples subdirectories and re-run
    "makemake vc".  You may also look at changing these files for
    various other reasons, such as if you don't like the way we name
    the DLL file, or want the 'install' target to put the MySQL++
    development files somewhere other than c:\mysql++.


Using MySQL++ in Your Own Projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(This material is based on a post by Steve Hulet <krigare@gmail.com>)

    Fire up VS .NET, create a Blank Solution.  Add a new project.
    Choose Empty Project (.NET) under Visual C++ Projects.  Add a
    .cpp file to the solution so it _knows_ it's a C/C++ solution.
    Go to the solution Property Pages and make the following changes.
    (Where it doesn't specify Debug or Release, make the change to
    both configurations.)

        o Under Configuration Properties::General change "Use
          Managed Extensions" to "No"

        o Under C/C++::General add to "Additional Include
          Directories": c:\mysql++\include, c:\mysql\include

        o Under C/C++::Code Generation change "Runtime Library" to
          "Multi-threaded Debug DLL (/MDd)" for the Debug
          configuration.  For the Release configuration, make it
          "Multi-threaded DLL (/MD)".

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

        o Under Linker::Input add to "Additional Dependencies":
          "libmysql.lib wsock32.lib mysqlpp.lib"


If You Run into Problems...
~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Especially if you have linking problems, make sure your project
    settings match the above.  Visual C++ is very picky about things
    like run time library settings.  If you still can't get things
    going, try running one of the example programs.  If it works,
    the problem is likely in your project settings, not in MySQL++.