blob: 8959c404d5b1e7df0687b027b200459014281dff [file] [log] [blame]
Brian Silverman70325d62015-09-20 17:00:43 -04001See the documentation in the doc/ directory for information about how
2to use the ctemplate library.
3
4COMPILING
5---------
6To compile test applications with these classes, run ./configure
7followed by make. To install these header files on your system, run
8'make install'. (On Windows, the instructions are different; see
9README.windows.) See INSTALL for more details.
10
11This code should work on any modern C++ system. It has been tested on
12Linux (Ubuntu, Fedora, RedHat), Solaris 10 x86, FreeBSD 6.0, OS X 10.3
13and 10.4, and Windows under both VC++7 and VC++8.
14
15There are a few Windows-specific details; see README.windows for more
16information.
17
18CTEMPLATE AND THREADS
19---------------------
20The ctemplate library has thread support, so it works properly in a
21threaded environment. For this to work, if you link libraries with
22-lctemplate you may find you also need to add -pthread (or, on some
23systems, -pthreads, and on others, -lpthread) to get the library to
24compile. If you leave out the -pthread, you'll see errors like this:
25
26 symbol lookup error: /usr/local/lib/libctemplate.so.0: undefined symbol: pthread_rwlock_init
27
28If your code isn't multi-threaded, you can instead use the
29ctemplate_nothread library:
30 -lctemplate_nothreads
31
32To summarize, there are two ways to link in ctemlpate in non-threaded
33applications. For instance:
34 1) gcc -o my_app my_app.o -lctemplate -pthread
35 2) gcc -o my_app my_app.o -lctemplate_nothreads
36
37If your application uses threads, you should use form (1).