Embedded Resources Compiler

Compile external resources directly into C++ source files

Download

Latest version: erc-0.4.0.tar.bz2

Description

This tool will generate a C++ source file (along with the corresponding header file) that embeds any given data file and provides a Resource class which gives access to this data. The Resource class can be created in two flavours: one using STL streams, the other is using WxWidgets streams.
If you know "qtrc" of the famous QT toolkit, then you know what this tool is doing too.

Requirements

This tool should run on any system that has a decent C++ compiler.

Installation

  1. Be sure your system meets the above requirements
  2. Download tarball above
  3. Unpack tarball:
    $ tar xjvf erc-x.x.x.tar.bz2
  4. Change into the new directory "erc" and compile it by:
    $ cd erc
    $ make
  5. Place the executable somewhere in your path, i.e. for a local install try:
    $ mv erc ~/bin
    Or, if you wan to make the program available for all users, do this as root:
    $ mv erc /usr/local/bin

Configuration

There is no configuration necessary.

If you are using Makefiles and (at least) a *nix-like environment and have your resources in a subdirectory called say "data", you can do something like this in your Makefile:

all:	resources $(PROGRAM)

resources:
	if ! [ -f Resources.cpp ] || 
		[ "`find data/ -newer Resources.cpp`" ]; then 
		erc -f wxWidgets -o Resources `find data/ -type f`; 
	fi

License

This software is open source, please read the disclaimer.