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 4058042
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:01:47+00:00 2026-05-20T15:01:47+00:00

Hey i’ve been following learncpp.com tuts for the last couple days, they say to

  • 0

Hey i’ve been following learncpp.com tuts for the last couple days, they say to comment out “#include “stdafx.h” from .cpp files for Code::Blocks.

Is that a must, to remove the include line? What happens if you had hundreds of files and changed from Visual Studio on Win7 to Code::Blocks on Linux or hand it off to someone else with a mac?

  • 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-20T15:01:48+00:00Added an answer on May 20, 2026 at 3:01 pm

    stdafx.h is the idiomatic name used for precompiled headers in the Visual Studio ecosystem. In a nutshell, it’s a regular header, but the contents of this file will be compiled once and reused for all cpp files in the project.

    That is useful since in most projects, a large number of headers (standard library, system header, shared project-wide definitions) are used by virtually all translation units (cpps), so using PCH is a huge performance benefit during compilation

    (Actually, PCH is a hack to workaround C++’ inefficient compilation and linkage model and it’s a shame that we need to maintain it by hand … oups, blasphemy.)

    But this also means that – as long as the contents of your stdafx.h are gcc-compatible – compilation with CodeBlocks should still work, but without the immediate performance benefit.

    The stdafx.h generated by VS’ app wizards doesn’t work out of the box on other platforms – it typically includes Windows.h. So to make it work, guard the Windows-specific definitions with appropriate #ifdef/#endif pairs and vice versa for Linux or Mac-specific stuff.

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

Sidebar

Related Questions

Hey I have been following gcm tutorial to create gcm-demo-server and a demo-client. All
Hey i have been looking around and i cant find a way to get
hey guys having this really simple problem but cant seem to figure out have
Hey all i have a JSFiddle that i have been working on with trying
Hey I have following code like this public object RetrieveItemRun(int item) { if (dictionary.ContainsKey(item))
Hey all i am trying to figure out what i am doing incorrectly here.
Hey I am trying to figure out what units of time this is measured
Hey bloggers out there! I've created Wordpress blog that I am hosting myself, and
Hey Folks i am trying to compile this C++ program: #include <stdio.h> #include <string.h>
hey guys was hoping you could help me out. I am working on a

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.