www.digitalmars.com         C & C++   DMDScript  

c++ - stupid questions about compiler

reply Mannon <mannonc yahoo.com> writes:
Okay so I got the dmc compiler. Very portable, awesome. And please
forgive me for being a coding noob.

I've got two questions...

First, how can I use the compiler from the command line on files
in any directory without it being in the path? I'm trying to
preserve portability, which means not setting all sorts of funky
paths or installing on the HD. (I'm using a flash drive.)

Second, is there any way to get dmc to only do a preprocess
compile like you can with VC++'s cl compiler? (I'm actually
wanting to use this on non C++ code but use the C++ preprocessor
directives. I would like to replace cl with dmc for this instead
of having both.)

Thanks
Feb 06 2007
parent reply Walter Bright <newshound digitalmars.com> writes:
Mannon wrote:
 Okay so I got the dmc compiler. Very portable, awesome. And please
 forgive me for being a coding noob.
 
 I've got two questions...
 
 First, how can I use the compiler from the command line on files
 in any directory without it being in the path? I'm trying to
 preserve portability, which means not setting all sorts of funky
 paths or installing on the HD. (I'm using a flash drive.)
Just prefix the dmc command with the path: \mypath\dmc file
 Second, is there any way to get dmc to only do a preprocess
 compile like you can with VC++'s cl compiler? (I'm actually
 wanting to use this on non C++ code but use the C++ preprocessor
 directives. I would like to replace cl with dmc for this instead
 of having both.)
You'll need the standalone preprocessor, sppn.exe, which comes on the DMC++ CD.
Feb 06 2007
next sibling parent Mannon <mannonc yahoo.com> writes:
awww yuck... Guess I'll stick with cl. Thanks.
Feb 06 2007
prev sibling parent reply Mannon <mannonc yahoo.com> writes:
Actually... I don't need to save the preprocessor output, I only
need it output. Which looks like -e will do.

I'm having trouble with it still though, because it's generating
compiler errors. Maybe this will help... Here is the equivalent cl
command line I'm trying to do.

cl /nologo /X /u /IE:\Docs\Scripts\ /TcE:\nnmuld.esl /EP

This results in the preprocessor outputting via cout basically,
but no file is generated, and it doesn't error on my non C++ code.

dmc nnmuld.esl /u /IE:\Docs\Scripts\ /e

This is as close as I've gotten in dmc, but it gives me compiler
errors and stops.
Feb 06 2007
parent Walter Bright <newshound digitalmars.com> writes:
Mannon wrote:
 Actually... I don't need to save the preprocessor output, I only
 need it output. Which looks like -e will do.
 
 I'm having trouble with it still though, because it's generating
 compiler errors. Maybe this will help... Here is the equivalent cl
 command line I'm trying to do.
 
 cl /nologo /X /u /IE:\Docs\Scripts\ /TcE:\nnmuld.esl /EP
 
 This results in the preprocessor outputting via cout basically,
 but no file is generated, and it doesn't error on my non C++ code.
 
 dmc nnmuld.esl /u /IE:\Docs\Scripts\ /e
 
 This is as close as I've gotten in dmc, but it gives me compiler
 errors and stops.
Yes, because even with -e, it must be valid C/C++ code. If not, sppn.exe is the tool to use.
Feb 06 2007