1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-09-28 19:05:49 +08:00
Go to file
2017-01-30 12:11:16 +01:00
contrib Tue Jan 24 16:00:51 2012 Google Inc. <google-ctemplate@googlegroups.com> 2012-01-25 01:28:24 +00:00
doc Tue Jan 24 16:00:51 2012 Google Inc. <google-ctemplate@googlegroups.com> 2012-01-25 01:28:24 +00:00
m4 Delete m4/namespaces.m4 2017-01-30 12:11:16 +01:00
packages Thu Mar 22 00:29:09 2012 Olaf van der Spek <olafvdspek@gmail.com> 2012-03-21 23:35:25 +00:00
src Remove GOOGLE_NAMESPACE 2017-01-30 11:43:52 +01:00
vsprojects Disable EditAndContinue on Windows due to conflict with SafeESH 2017-01-04 09:43:23 +01:00
AUTHORS Tue Jan 24 16:00:51 2012 Google Inc. <google-ctemplate@googlegroups.com> 2012-01-25 01:28:24 +00:00
autogen.sh Update autostuff 2017-01-29 11:03:37 +01:00
ChangeLog Wed Mar 19 20:02:51 2014 Olaf van der Spek <olafvdspek@gmail.com> 2014-03-19 19:31:53 +00:00
configure.ac Delete m4/google_namespace.m4 and m4/stl_namespace.m4 2017-01-30 11:59:37 +01:00
COPYING ctemplate 0.1 2007-03-21 23:06:14 +00:00
ctemplate.sln Upgrade project files to VS2015. 2016-05-29 12:01:13 +02:00
Makefile.am Modernise Autotools build system 2017-01-27 23:29:15 +01:00
NEWS Wed Mar 19 20:02:51 2014 Olaf van der Spek <olafvdspek@gmail.com> 2014-03-19 19:31:53 +00:00
README Thu May 7 11:27:28 2009 Google Inc. <opensource@google.com> 2009-05-07 15:35:04 +00:00
README_windows.txt Tue Jan 24 16:00:51 2012 Google Inc. <google-ctemplate@googlegroups.com> 2012-01-25 01:28:24 +00:00
README.md New github friendly README file with links to the html docs. 2015-09-04 16:04:56 +02:00

Welcome to the C++ CTemplate system!

This library provides an easy to use and lightning fast text templating system to use with C++ programs.

It was originally called Google Templates, due to its origin as the template system used for Google search result pages. Now it has a more general name matching its community-owned nature.

Documentation

Refer to the Project Documentation to learn how to use the CTemplate system.

There is also a HOWTO and Examples.

Compiling

To compile test applications with these classes, run ./configure followed by make on unixoid platforms like Linux or MacOSX.

To install these header files on your system, run make install.

See INSTALL for more details.

This code should work on any modern C++ system. It has been tested on Linux (Ubuntu, Fedora, RedHat), Solaris 10 x86, FreeBSD 6.0, OS X 10.3 and 10.4, and Windows under both VC++7 and VC++8.

There are a few Windows-specific details; see README.windows for more information.

CTemplate and Threads

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 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. Thread safe build:gcc -o my_app my_app.o -lctemplate -pthread

  2. Unthreaded code:gcc -o my_app my_app.o -lctemplate_nothreads

If your application uses threads, you should use form (1).