In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to match the function definition with the existing declaration. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!
In the whole MFC, the following problems were encountered.
d:\My documents\visual studio 2008\projects\virtuosc\arraylisttype.h (171) : error C2244:
'arrayListType::maxListSize': Cannot match function definition to existing declaration
1> d:\My Documents\visual studio 2008\projects\virtuosc\arraylisttype.h (37) : See
Declaration of "arrayListType::maxListSize"
1> Definition
1> 'int arrayListType::maxListSize(void)'
1> Existing claims
1> 'int arrayListType::maxListSize(void)'
Think for a long time have not been able to solve, and later in Baidu's help to solve. The problem was actually very easy to solve. It was just that he did not expect it, but he had no choice. He did not expect it to be unexpected. Write down the problem now, and the next time it comes up, it can be solved quickly. The solution is as follows:
Before arraylisttype.h, insert:
#ifndef ARRAYLISTTYPE_H
#define ARRAYLISTTYPE_H
At the end of arraylisttype.h insert:
#endif
This way the header file arraylisttype.h will not be duplicated and cause compilation errors. Now explain the above statement.
#ifndef ARRAYLISTTYPE_H means "if macro ARRAYLISTTYPE_H is not defined"
#define ARRAYLSTTYPE_H means "define macro ARRAYLSTTYPE_H"
#endif means "end"
In general, if the identifier ARRAYLISTTYPE_H is not defined, define the identifier ARRAYLISTTYPE_H and let the code between #ifndef and #endif be compiled. If the header file ARRAYLISTTYPE_H is included a second time, the statement #ifndef becomes invalid, and all statements before #endif are ignored by the compiler. ---- Data Structure Using C++,D.S.Malik
Write your own header file later. Be sure to add the above preprocessing command
That's all for "What if I can't match a function definition to an existing declaration?" Thanks for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.