TuX as LLG logo
Driver Suite for Linux
csv2iif.pl suite
convert PayPal transactions to IIF, OFX, QIF
DMX30 Interface
128Ch SPP
DMX43 Interface
2out 2in EPP
LED Hardware
for Linux and Windows
EPROM Sampler
for 8 bits of sound
Linux drivers for MK3/4 PCI
PostgreSQL replication
C exception/signal handling lib
to various software
and small scripts
misc documents
to lighting stuff

c++int - a C++ interpretor wrapper

c++int is a program to execute C++ files without the compile/link steps. It's intended to be used similar to script languages (perl, python) on Unix systems with the shebang syntax. The following example should make everything clear.

If you have installed the c++int program into the /usr/bin/ directory you can create a file test.cpp with the following content:

#!/usr/bin/c++int -Wall
#include <iostream>
int main(int argc, char **argv)
  std::cout << "my c++ interpreter is working!\n";
  for(int i=1; i<argc; ++i)
    std::cout << "command line argument #" << i << ": " << argv[i] << std::endl;
  return 0;
You can now either execute the program by calling it with the c++int program on the command line like:
$ c++int test.cpp
my c++ interpreter is working!
Or you can make the test.cpp file executable and call it directly:
$ chmod +x test.cpp
$ ./test.cpp
my c++ interpreter is working!


You can prefix a C++ source code file with the Unix shebang to execute the source code file with the c++int program. Add
as the first line. If you need additional compiler flags you can add them to the shebang line.

If you need to supply arguments to your C++ program you have to prefix them with --, to distinguish them from compiler options:

$ ./test.cc -- test
my c++ interpreter is working!
command line argument #1: test
You have to be careful if your arguments contain whitespace, because the whitespace will be interpreted twice by the unix shell (once in the original call, the second time when the compiled program is executed). The following example does not work as expected when the argument is only quoted once:
$ ./test.cc -- "first argument"
my c++ interpreter is working!
command line argument #1: first
command line argument #2: argument
To work around this issue you can quote the argument twice:
$ ./test.cc -- "'first argument'"
my c++ interpreter is working!
command line argument #1: first argument

You can control the execution of c++int with two special environment variables:

When this variable is set to any value, c++int will print debug messages about its execution.
This variable should specify a directory name. If the directory is writable by the user the compiled program will be saved in the directory. This allows a faster execution of C++ programs.


c++int-1.0.tar.gz released 2012-07-04.


Write an email to Dirk Jagdmann for questions and suggestions.

http://llg.cubic.org © 2001-2018 by Dirk Jagdmann