problem with VC++ 6.0 IDE and header file changes

Posted on 2005-03-23
Medium Priority
Last Modified: 2006-11-17
This has been bugging me for a while, maybe my project is setup wrong. I'm using VC++ 6.0 and it seems that if I add a new member variable to a header file and then try to recompile the class, I'm shown a compile error for an unknown reference, until I go and rebuild the entire project.

any idea why this is?
Question by:PMH4514
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
  • 4
  • 2
LVL 30

Accepted Solution

Axter earned 200 total points
ID: 13615305
Hi PMH4514,
Sounds like something is wrong with the dependancy settings, or maybe all the files are not included in the project.

Are you sure that ALL the header files (*.h) are included in the project?
When you look at FileView does it include all the header files for your project?

David Maisonave :-)

Author Comment

ID: 13615343
I don't see any missing .H files from the project. dependencies appear ok as well.

I had a similar problem once when I had gotten the bluescreen of death and for whatever reason, BIOS date was set back to 1999 and I hadn't noticed, since the dates were all weird, I kept having to recompile.. but that's not the case this time :)
LVL 30

Expert Comment

ID: 13615360
Can you post the exact compile error?
Technology Partners: 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!


Author Comment

ID: 13615481
ok for example, CDisplay - a class that compiles successfully.. I just opened up Display.h and added:

  CRect* m_pTest;

and then within the constructor for CDisplay I added:

m_pTest = NULL;

and I then right-clicked Display.cpp and hit compile, and I get this:

E:\CODE\Display.cpp(38) : error C2065: 'm_pTest' : undeclared identifier
Error executing cl.exe.

Display.obj - 1 error(s), 0 warning(s)

if I then go to the Build menu and rebuild all and wait for the whole project to recompile, it compiles just fine.. subsequent right-click/compile on Display.cpp work just fine..

and I get a similar thing anytime I change any header and try to recompile just that class

Author Comment

ID: 13615626
possibly a project or workspace file is protected under source safe?

Author Comment

ID: 13643809
>>Are you sure that ALL the header files (*.h) are included in the project?
wow, that was it actually.. I looked and looked and looked some more and thought everything was in place.. first sip of coffee this morning and suddenly I said to myself "oh, wait a sec.."

there were two files missing from the project, that were in the folder.

odd.. but thanks!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

765 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