C + + class does not name a type (reprint)

Source: Internet
Author: User

Reprint: http://blog.csdn.net/typename/article/details/7173550

Declare class does not name a type

There are four possible reasons for this compilation error, which is summarized as follows:

1. The referenced class namespace does not contain

2. The referenced class header file does not contain

3. If the header file is included or has been pre-declared, the referenced class name is incorrectly written.

4. Circular Reference header file

Pre-declared features:

1. The preceding statement requires attention to the four points mentioned above

2. Use the pre-declaration as much as possible (do only header files that contain inherited classes)

3. when using a predecessor declaration, the Include header file order in the CPP file must first contain the class definition header file for the predecessor declaration, and then include the header file of the class.

Otherwise, the following compilation error will occur.

(expected constructor, destructor, or type conversion before ' typedef ')

C + + class does not name a type (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.