PMH4514
asked on
problem with VC++ 6.0 IDE and header file changes
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?
any idea why this is?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you post the exact compile error?
ASKER
ok for example, CDisplay - a class that compiles successfully.. I just opened up Display.h and added:
private:
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:
Compiling...
Display.cpp
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
private:
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:
Compiling...
Display.cpp
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
ASKER
possibly a project or workspace file is protected under source safe?
ASKER
>>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!
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!
ASKER
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 :)