Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:36:48+00:00 2026-05-27T18:36:48+00:00

Related question here: How can I run the MSVC preprocessor and compiler in two

  • 0

Related question here: How can I run the MSVC preprocessor and compiler in two separate steps?

I explicitly pre-process a MyFile.cpp (not compile) to a MyFile.i. I want to later “compile” that file (explicitly skipping preprocessing would be nice, but as the related question suggests, it sounds like that is not possible with MSVS.)

PROBLEM: The MyFile.i is an “unrecognized extension”, and cl.exe assumes it is an “object file” resulting in a “no-operation”. (See Microsoft warning: http://msdn.microsoft.com/en-us/library/zfsbakc5(v=VS.90).aspx, this warning is active for MSVS 2005, 2008, 2010).

I can’t find a switch to state that it is a “source file” (not an object file). The related question explicitly used the “MyFile_preprocessed.cpp” convention, but I’d really rather stay with the (more-universal) MyFile.i convention.

QUESTION: Is there a flag where I can compile a MyFile.i with MSVS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:36:49+00:00Added an answer on May 27, 2026 at 6:36 pm

    cl.exe has these two flags

    • /Tc<source file> compile file as .c

    • /Tp<source file> compile file as .cpp

    that lets you compile files with arbitrary extension as c or c++ files

    I tried compiling a main.i with the following contents

    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        cout << "Hello world \n";
        return 0;
    }
    

    with cl /Tp main.i and it works as advertised

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a custom autoloader based on Zend Framework's autoloading (related question here ).
Related question [stackoverflow] here . I'm trying to do the above, but I want
Related to my question here but not enough to open a new question. I
This question is related to the question posted here: Why isn't my custom WCF
The question is closely related to my past question here, but it is not
Please see here for a related question . However, char goes to 0xffff (or
This is related to my previous question here . I want 4 divs (absolute
My initial question was here and was related to the postgres backend. Postgres subquery,
This is related to a question I asked here: Thread Locking in Ruby (use
Related to a question I asked earlier here , I've found a problem which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.