What compiler(s) are you using --C, C++, or Fortran?
What version of Studio are you using?
The exact answer might depend on the compiler and version.
But before looking at replacements for the compiler's own preprocessor, do you really want to run your own preprocessing program? If so, the the recognition of source code and the output format need to be compatible with the compiler.
If you just want to separate preprocessing from the rest of the compilation, you can use the -P or -E options to get the preprocessor output, then compile that output. To maintain correspondence with the original source code files and lines, you would use the -E option. C example:
% cc -E hello.c > newhello.c
% cc newhello.c
For C++, templates can introduce problems when you expect the compiler to find template definitions automatically, as is the case with the standard library. You will probably need to add the option -template=no%extdef to be able to compile template code. C++ example:
% CC -E -template=no%extdef hello.cc > newhello.cc
% CC -template=no%extdef newhello.cc
Refer to the C++ Users Guilde chapters on template compilation models for for details.