3
NOTES FOR COMPILING ON WINDOWS
7
Ellers, ellers@iinet.net.au
17
I have rebuilt the FTGL project files for Visual C++ (version 6). There are
19
presently no other compilers or environments supported but feel free to
27
QUICK GUIDE: COMPILING FTGL
31
- Start up MSVC++ with ftgl.dsw.
33
- Tell MSVC++ where FreeType is. You'll need to do something like this:
37
* select Project>Settings
39
* select ftgl_static (for a start)
41
* select "All Configurations"
43
* go to the tab C++ > PreProcessor
45
* Set additional include directories appropriately. For me it is:
47
D:\cots\freetype-2.0.5\include
49
* repeat for all configurations of ftgl_dll
55
QUICK GUIDE: COMPILING/RUNNING SUPPLIED DEMO PROGRAM
59
- The program expects the first argument to be the name of a truetype file.
61
I copied timesbi.ttf from the windows directory to C:\TEMP and then edit
63
the settings of the project:
67
* select Project>Settings
71
* select panel Debug>General
73
* set Program Arguments to be "C:\TEMP\timesbi.ttf"
79
QUICK GUIDE: COMPILING YOUR PROGRAM TO USE FTGL
83
- Choose dynamic or static library linkage
85
* if you want to link to a static FTGL library ensure that
87
FTGL_LIBRARY_STATIC is defined in the preprocessor section
93
CONFIGURATION / CODE GENERATION / C LIBRARIES
97
FTGL can be built in various configurations (inspired by Freetype and libpng):
101
- static library (.lib)
103
- dynamic library (.dll)
107
MSVC++ requires selection of "code generation" option, which seems to be
109
mostly to do with which version of the Standard C library is linked with the
115
The following modes are supported:
121
- single threaded (ST) or multithreaded (MT)
123
NOTE: the multithreaded DLL (MD) mode was NOT included, as freetype itself
125
doesn't support that mode so I figure there's no point yet.
127
- debug/release (debug has _d suffix)
131
So the static multithreaded release library is:
139
The same library built in DEBUG mode:
147
If you're not sure which one is appropriate (and if you're a novice don't
149
been too put off...) start with making the decision about debug or release.
151
This should be easy because if you're building the debug version of your
153
app its probably a good idea to link with the debug version of FTGL (but
155
not compulsory). Once thats done, you may get errors like:
159
LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib "libcmt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
163
This will happen, for example, when you link a glut app with an FTGL library
165
compiled with different codegen options than the GLUT library.
171
requires that all libs be linked with the same codegen option. GLUT is built
173
in XXX mode, so if you're linking with GLUT, you can get rid of the warning
175
by linking with the XXX version of FTGL. The various versions are particularly
177
useful if you're doing std C stuff, like printf etc.
189
Q: "But... do I HAVE to use all these DIFFERENT build modes, like multi-
191
threaded, debug single threaded, etc?"
195
A: No. Sometimes library makers only generate one style anyway. It depends
197
on your needs. Unless you're linking with standard C stuff (e.g. printf)
199
then it probably won't make a great deal of difference. If you get
201
warnings about "default lib libcmt.lib conflicts" etc, then you can make
203
use of the different libraries.