About C + + program compile error c2143:syntax error:missing '; ' Before ' type ' solution __c++

Source: Internet
Author: User

The rules are set by man, why I don't know qaq. (>﹏<. ) ~ Woo-hoo ... In pure c, a variable declaration must be at the front of a code block

When running the program found a problem, with VC 6.0 compiled C language is always prompted an error: Error c2143:syntax error:missing '; ' Before ' type '. The workaround is to place the declaration of all variables before the executable code .

This problem occurs because the file is saved as a. c format. If the CPP format can be compiled correctly. The change to the. CPP will work, and the position of your variable declaration is not related. *

In ANSI C or C + +, it is permissible to define a variable at any time in the executable code, but it is not allowed in K&r C, so this error occurs. VC6.0, VS2008 are used k&r C to achieve the C language, so the compilation process will be an error.

About C Free 5 appears no such file or directory. Some of the errors that occurred together.

Workaround: If the name of the installation directory has spaces, the system may not find the path.
We can try to change the name of the installation directory to simple, do not have a space.

has been bothering me to solve the problem of good fun, only in the process of solving the problem can realize that kind of happiness, and we encourage, hope to have the same troubled people to help.

Wrote by Markpain 20160908

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.