Solved

Telling VC to generate stdafx.h

Posted on 2001-06-17
4
833 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
  • 2
4 Comments
 
LVL 3

Expert Comment

by:elcapitan
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now