Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing code through the preprocessor only

Status
Not open for further replies.

semblance

Programmer
Joined
May 25, 2006
Messages
2
Location
US
Hi, I'm trying to convert a large Visual Studio 6 C++ project to Java. I could find a converter tool, but I'd rather do it by hand as an exercise to understand the code.

My question is whether there is a way to pass the code through the Visual C++ compiler such that it *only* interprets the preprocessor directives. There are quite a few #defines and #ifdef directives around, and I'm not certain which are used and which are ignored.
 
See /P (and /C) compiler directive(s).
For example, preprocess file.cpp to file.i in cmd line:
Code:
cl /P file.cpp
You may set this directive in IDE too (see Project Setting panel).
 
Cool, thanks. Exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top