www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



c++ - stupid questions about compiler

↑ ↓ ← 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
↑ ↓ 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
→ Mannon <mannonc yahoo.com> writes:
awww yuck... Guess I'll stick with cl. Thanks.
Feb 06 2007
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
↑ ↓ → 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