Several possibilities for "error C3646: unknown rewrite specifier"

Source: Internet
Author: User

If error C3646 is present in the program, then this error may be caused by a number of problems, and this article will analyze a variety of errors and corresponding workarounds.

On the official MSDN website, complier Error C3646 is defined as unknown override specifier and is interpreted as the compiler found a token in the position where it E Xpected to find a override specifier, but the token is not a recognized by the compiler.

1. Circular references

In separate compilation, we tend to write different classes or functions separately in different functions, improve work efficiency. However, if two classes are written in two different files when they are used, and they are referenced to each other, a circular reference will be thrown to raise this error.

Examples: Tire.h/tire.cpp and auto.h/auto.cpp include auto.h in tire.h, define an auto object, and then include Auto.h in Tire.h

Solution: The class definition of the. h file that was added to the error is preceded by the class declaration called classes (that is, Class).

2. Syntax errors

This problem is mostly caused by carelessness, such as a semicolon in a member function, and a Chinese semicolon, and such an error will occur.

Solution: Modify the semicolon

3. Sequence errors for classes

If a member of a class contains another class, the life of the contained class must precede the containing class.

Example:

class Auto {      class  Tire {      int  weight;   // This would cause error C3656

Workaround: Adjust the position of the class.

In the face of this problem, we need to see the essence through the phenomenon.

Merry Christmas to everyone:)

Several possibilities for "error C3646: unknown rewrite specifier"

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.