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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:55:23+00:00 2026-05-24T01:55:23+00:00

I am working on a project that has a vendor-provided API. I’ve made a

  • 0

I am working on a project that has a vendor-provided API. I’ve made a class that uses that API in my project and I’ve included the vendors header file in my stdafx.h file. Things would not compile.

I then put the #include directly into my class’ header file and now things compile (And yes, my class includes stdafx.h so that isn’t the reason.

Do any of you have any guesses as to why it wouldn’t compile the first time around? This isn’t a project-stopper by far but I’d prefer if I could keep all vendor API files in stdafx.h where they belong.

EDIT: Problem solved, I’d created a cyclic dependency by forgetting to #ifndef a header file and then including them in the wrong order. I feel like an idiot.

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

    stdafx.h is mainly used in the VS generated projects as the ‘container’ of headers to be precompiled.

    When you added a new #include to stdafx.h it didn’t get included because your project is probably configured to use precompiled headers, and when you add something to stdafx.h you need to regenerate the .pch file that contains the precompiled information.

    One way to do that is to have a .cpp file in your project that does nothing but #include "stdafx.h". Maybe call it `precompile.cpp”. Then go to the project settings for that one .cpp file and change the following setting (for all configurations):

    "C/C++ | Precompiled Headers | Precompiled Header" setting 
    

    and select "Create /Yc".

    That will set up the build so that when precompile.cpp needs to be built (because the stdafx.h header it includes has changed), it’ll rebuild the .pch file that everything else uses.

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

Sidebar

Related Questions

I am working in a project that has two main parts: a class library
I'm working on a project that has a proprietary file format. The project has
I am working on a project that has grown to a decent size, and
I'm working on a project that has a rich object model with various sets
I have been working on a project that has 2 interfaces - windows forms
I'm working on a project that currently has zero users but we would like
I'm working on a C#/ASP.NET project that has all the javascript files in a
I am working on implementing Zend Framework within an existing project that has a
Right now a project I'm working on has reached a level of complexity that
I'm working a project that has recurring, weekly events. Thus, I use several DateTime

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.