Solved

Telling VC to generate stdafx.h

Posted on 2001-06-17
4
865 Views
Last Modified: 2013-11-20
Hi,

I got some source files which i am putting in a project . They  make use of MFC, I changed the settings of the project, to "USE MFC LINKED"

But when i build the project it still can't find "stdafx.h"

How do i instruct vc to regenerate stdafx.h?

Cheers

Rich  
0
Comment
Question by:RichJackson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:elcapitan
ID: 6200956
>>But when i build the project it still can't find "stdafx.h"
>>How do i instruct vc to regenerate stdafx.h?

I'm not sure that I understood the problem, but I think it is better to tell the compiler in this case not to use precompiled header. Do that at: project->settings->/c/c++->precompiled headers. select Not using precompiled headers.

--EC--
0
 

Author Comment

by:RichJackson
ID: 6201944
Basically I had a CPP file, which i wanted to run.  Which had no workspace or project.

I ended up creating a new one and copying in stdafx.h stdafx.cpp and resource.h

But i though VC should have handled all this for me

Thanks For Your Time
0
 
LVL 3

Expert Comment

by:elcapitan
ID: 6202301
You can create new win32 project (file->new->projects->win32 application). Make sure you selected: 'A simple win32 application'. A project with stdafx.h stdafx.cpp and another .cpp file was created. Now you can copy/paste from the old project into the new project.

--EC--
0
 
LVL 2

Accepted Solution

by:
agriggs earned 10 total points
ID: 6202665
I think if you just double-click on the CPP file, VC will load it and create a workspace that is at least somewhat appropriate for running it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question