Question Concerning Converting a VS97 C++ DLL to VS2003 Code Base

  • Thread starter William F. Zachmann
  • Start date
W

William F. Zachmann

I am working on a project converting a DLL originally written in C++ using
Visual Studio 97 accessing a SQL 6.5 data base to VS.Net 2003 and SQL Server
2000. I would very much appreciate any suggestions and/or references to
good sources for information about issues I am likely to encounter along the
way.

My immediate issue, however, is that after opening the old project and
accepting the conversion to VS2003, a build fails with five instances of
"fatal error C1083: Cannot open precompiled header file: '.\Debug/*.pch': No
such file or directory" -- one for each of the five .cpp files in the
project. In each case the line flagged in the .cpp file is the #include
reference to stdafx.h. There definitely is a stdafx.h file in the project
directory. It's contents are as follows:

#if !defined(AFX_STDAFX_H__0893D76C_BC95_11D0_A4F4_C8890AC10000__INCLUDED_)

#define AFX_STDAFX_H__0893D76C_BC95_11D0_A4F4_C8890AC10000__INCLUDED_

// stdafx.h : include file for standard system include files,

// or project specific include files that are used frequently, but

// are changed infrequently

//

#include <afx.h>

#include <afxwin.h>

#include <afxmt.h> // for synchronization objects

#include <afxext.h>

#include <afxisapi.h>

//{{AFX_INSERT_LOCATION}}

// Microsoft Developer Studio will insert additional declarations
immediately before the previous line.

#endif //
!defined(AFX_STDAFX_H__0893D76C_BC95_11D0_A4F4_C8890AC10000__INCLUDED)


Running the build with a /Fc flag generates a mess of errors. Do I need to
deal with each of those individually, or is there something specific
regarding stdafx differences between VS97 and VS2003 that may the the source
of the errors? Is it possible that I might be able to get around this by
simply changing the contents of stdafx.h? I tried creating a new MFC DLL
project and then using the stdafx.* files VS2003 created for it to replace
those in the original project, but that did not affect the C1083 errors.
Any ideas as to what might be my best (and easiest) way through this?

Any help in sorting out this issue and any others regarding moving this code
from VS97 to VS2003 will be most appreciated. Thanks!

All the best,

will
 
R

Ronald Laeremans [MSFT]

What are the project compiler settings for stdafx.h. It should have "Create
precompiled header" (i.e.) /Yc set.

Ronald Laeremans
Visual C++ team
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top