You receive a "Cannot find the definition of this function" error message when you try to go to definition in ClassView in Visual C++ (154112)
The information in this article applies to:
- Microsoft Visual C++ 4.0
- Microsoft Visual C++ 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
This article was previously published under Q154112 SYMPTOMS ClassView pops up the message "Cannot find the definition
for this function" for some member functions of a template class. This happens
for those member functions that return a template class, or a reference or
pointer to a template class. The function must also be defined outside of the
class. The sample code in the More Information section below demonstrates this
problem. In Visual C++, version 4.x,
ClassView cannot find any template member function or variable defined outside
of the class. The error message reads: Cannot find the
definition (implementation) of this function. RESOLUTION The only workaround is to define the function inline by
moving its body inside the class declaration. Note that defining the function
outside the class declaration with the inline keyword will not solve the
problem. Also note that projects with this problem will still build and run
correctly; only the convenience of finding a function's definition via the
ClassView is lost. STATUS Microsoft has confirmed this to be a bug in the Microsoft
products listed at the beginning of this article. This bug was corrected in
Visual C++ version 5.0.
Modification Type: | Major | Last Reviewed: | 9/1/2005 |
---|
Keywords: | kbBug kbCompiler kbCPPonly kberrmsg kbfix kbNoUpdate kbui kbVC500fix KB154112 |
---|
|