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

  • Home
  • SEARCH
  • 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 813147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:18:48+00:00 2026-05-15T01:18:48+00:00

When I add an include guard to my header file for a Visual C++

  • 0

When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error:

warning C4603: ‘_MAPTEST_H’ : macro is not defined or definition is different after precompiled header use

Add macro to precompiled header instead of defining here

.\MapTest.cpp(6) : use of precompiled header** // the precompiled header stdafx.h is included in this line

.\MapTest.cpp(186) : fatal error C1020: unexpected #endif

but when I add the precompiled header before the include guard, no warning or error is emitted. What is the reason for this?

  • 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-15T01:18:49+00:00Added an answer on May 15, 2026 at 1:18 am

    Two problems I can think of:

    1. According to this, Visual C++ won’t compile anything before the line where you include stdafx.h – so that line needs to be the very first one in the file. If you put it after the macro definition, it gets skipped, hence the errors you’re seeing.

    2. Identifiers starting with a leading underscore and a capital letter (or double leading underscores) are reserved, which might be causing a name conflict. see this answer for more details.

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

Sidebar

Related Questions

What is the idiomatic way to add an include guard in a ruby file
Possible Duplicate: How do I add a directory to C header include path? I
In project with many multiple targets, I wish to add include libraries for a
I have a Visual Studio 2008 solution with around 10 projects. When I add include directories
How do you include add, remove, and back buttons in ListActivity .pl?
I can't seem to find in Xcode how can I add an include dir
I need to add a new SELECT statement whose search condition include something like
I'm trying to add jQuery using Greasemonkey's @require / @include method, but it doesn't
I created a program called test: #include<stdlib.h> #include<iostream> int main() { std::cout<<system(..\\add\\debug\\add.exe 4 8);
Using Your Ruby Gem(s) You will need to add /home/username/ruby/gems to the include path.

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.