From: Nondisclosure007 on
I'm using Visual Studio 2010.

Here's what I get as an error when I try to compile my DLL:
Error 1 error C1083: Cannot open precompiled header file: 'Debug
\MyDll.pch': No such file or directory c:\users\michael\documents
\visual studio 2010\projects\mydll\mydll\mydll.cpp 4 1 MyDll

Well, here's the steps I take when creating this project:
File, New Project
Win32 Console Application
I enter a name in Name and click OK.
When the wizard comes up, I click Next
Application settings, the ONLY thing that is checked is DLL under
'Application Type'. (Visual Studio greys out 'pre compiled headers
option, and puts a check in it. I've tried various ways to remove it,
but haven't been able).
Hit Finish.
I enter NO more code in.
click on Build, Compile. And that's when I get that error.

Why? It should just compile with nothing in it.
From: Igor Tandetnik on
Nondisclosure007 wrote:
> I'm using Visual Studio 2010.
>
> Here's what I get as an error when I try to compile my DLL:
> Error 1 error C1083: Cannot open precompiled header file: 'Debug
> \MyDll.pch': No such file or directory c:\users\michael\documents
> \visual studio 2010\projects\mydll\mydll\mydll.cpp 4 1 MyDll
>
> Well, here's the steps I take when creating this project:
> File, New Project
> Win32 Console Application
> I enter a name in Name and click OK.
> When the wizard comes up, I click Next
> Application settings, the ONLY thing that is checked is DLL under
> 'Application Type'. (Visual Studio greys out 'pre compiled headers
> option, and puts a check in it. I've tried various ways to remove it,
> but haven't been able).
> Hit Finish.
> I enter NO more code in.
> click on Build, Compile. And that's when I get that error.

The first time round, do Build | Build Solution. You are trying to compile a single file that uses precompiled headers, but first another file needs to be compiled (usually called stdafx.cpp) that generates these same precompiled headers.

If you don't want to use precompiled headers, set Project | Properties | C/C++ | Precompiled Headers | Create/Use Precompiled Headers = Not Using Precompiled Headers.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
From: Nondisclosure007 on
On May 17, 5:01 am, "Igor Tandetnik" <itandet...(a)mvps.org> wrote:
> Nondisclosure007 wrote:
> > I'm using Visual Studio 2010.
>
> > Here's what I get as an error when I try to compile my DLL:
> > Error 1 error C1083: Cannot open precompiled header file: 'Debug
> > \MyDll.pch': No such file or directory c:\users\michael\documents
> > \visual studio 2010\projects\mydll\mydll\mydll.cpp 4 1 MyDll
>
> > Well, here's the steps I take when creating this project:
> > File, New Project
> > Win32 Console Application
> > I enter a name in Name and click OK.
> > When the wizard comes up, I click Next
> > Application settings, the ONLY thing that is checked is DLL under
> > 'Application Type'. (Visual Studio greys out 'pre compiled headers
> > option, and puts a check in it.  I've tried various ways to remove it,
> > but haven't been able).
> > Hit Finish.
> > I enter NO more code in.
> > click on Build, Compile.  And that's when I get that error.
>
> The first time round, do Build | Build Solution. You are trying to compile a single file that uses precompiled headers, but first another file needs to be compiled (usually called stdafx.cpp) that generates these same precompiled headers.
>
> If you don't want to use precompiled headers, set Project | Properties | C/C++ | Precompiled Headers | Create/Use Precompiled Headers = Not Using Precompiled Headers.
> --
> With best wishes,
>     Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925- Hide quoted text -
>
> - Show quoted text -

Thanks. I'll try that.