Discussion:
Completely confused
(too old to reply)
Nondisclosure007
2010-05-17 01:31:11 UTC
Permalink
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.
Igor Tandetnik
2010-05-17 12:01:51 UTC
Permalink
Post by Nondisclosure007
I'm using Visual Studio 2010.
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
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
Nondisclosure007
2010-05-20 17:01:58 UTC
Permalink
Post by Igor Tandetnik
Post by Nondisclosure007
I'm using Visual Studio 2010.
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
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.

Loading...