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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nietodConnect With a Mentor Commented:
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
 
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
All Courses

From novice to tech pro — start learning today.