MSVC++ v6 IDE Question

When writing a new class I tend to write my header files and then go to implement them. Unless there is some code which actually calls the function, my compiler doesn't complain when a class prototypes a function in its header but does not define it anywhere.

Is there an option to make VC++ check for this and tell me about it? It's annoying when I think I've done all the work and then go to use the class later and find I missed something and have to get my head back in to the internals of the class...

(I can understand why it's not an error by default and perhaps why you simply wouldn't want it to be an error in some cases, but I definitely want it to be an error for my own classes.)
LVL 1
jhattinghAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

abdijCommented:
Hi,
 If the function is declared in the header but not implemented and the function is called no where then the VC++ 6.0 compiler does not give any error under normal settings. I will try to find if there is any Option to do what you want.

Bye
Abdij
0
nietodCommented:
There is no feature to check for this "error", because it is not a error.  This is required by the C++ standard.  A function declaration does not have to be defined if the function is never used.  This feature is actually used by many C++ programmers.  For example, to make a class whos objects cannot be copied (passed by value, returned by value,, for example) you can declare a copy constructor for the class and then not define it.  If the user tries to copy construct the class, an error will be reported, otherwise everything will be okay.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.