mirror of
https://github.com/OlafvdSpek/ctemplate.git
synced 2025-09-28 19:05:49 +08:00
22 lines
914 B
Plaintext
22 lines
914 B
Plaintext
See the documentation in the doc/ directory for information about how
|
|
to use the ctemplate library.
|
|
|
|
The ctemplate library has thread support, so it works properly in a
|
|
threaded environment. For this to work, if you link libraries with
|
|
-lctemplate you may find you also need to add -pthread (or, on some
|
|
systems, -pthreads, and on others, -lpthread) to get the library to
|
|
compile. If you leave out the -pthread, you'll see errors like this:
|
|
|
|
symbol lookup error: /usr/local/lib/libctemplate.so.0: undefined symbol: pthread_rwlock_init
|
|
|
|
If your code isn't multi-threaded, you can instead use the
|
|
ctemplate_nothread library:
|
|
-lctemplate_nothreads
|
|
|
|
To summarize, there are two ways to link in ctemlpate in non-threaded
|
|
applications. For instance:
|
|
1) gcc -o my_app my_app.o -lctemplate -pthread
|
|
2) gcc -o my_app my_app.o -lctemplate_nothreads
|
|
|
|
If your application uses threads, you should use form (1).
|