After adjusting the reference sequence, it seems as clear as the Blue Sky. error C2146: syntax error: Missing ";" (in the identifier

Source: Internet
Author: User

> E:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (58): error C2146: syntax error: Missing ";" (before the identifier "m_ConnectManager)
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (58): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (58): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (116): error C2143: syntax error: ";" missing (before)
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (116): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (116): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (118): error C2146: syntax error: ";" missing (before identifier "m_mapTcp)
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (118): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (118): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (121): error C2146: syntax error: Missing ";" (before the identifier "m_CESeriesGps)
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (121): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> e:/work/workcode/ppc vs2008/mobilepos/gpsgui/GpsGuiDlg. h (121): error C4430: The type descriptor is missing-it is assumed to be int. Note: C ++ does not support default int
1> ConnectManager. cpp
1> MapTcp. cpp
1> CESeries. cpp
1> HttpSocket. cpp
1> generating code...
1> the generated logs are stored in "file: // e:/work/workcode/PPC VS2008/MobilePOS/GpsGui/Windows Mobile 6 Professional SDK (ARMV4I)/Debug/BuildLog.htm"
1> GpsGui-12 errors and 1 warning
============ Generate: 0 successful, 1 failed, 0 latest, skipped 0 ==========

 

 

When I encountered this problem, I put a few quote prices in stdafx. h to solve the problem. Thanks for the following.

 

Http://www.cnblogs.com/tianyige/archive/2008/12/31/1365725.html hereby declares and thanks.

Error C2146: syntax error: Missing ";"

Recently, I used VC7 as a small software. The main function is to regularly scan the data received by GPRS and store it in the database. Register the software as a windows service. After all the work is done, I started to implement this function. In fact, you do not need to write any code in the program. You only need to execute a batch file to complete the service perfectly. But I still want to try out how to use the program to implement this function.
In the VC knowledge base, finding an article is actually not difficult in principle. It is nothing more than converting the program's entry from the main function to the service console. The article is named "five steps for compiling Windows service programs in C language". If you are interested, refer to it. What I want to talk about here is that VS2003 is used as a development tool, which is different from VC6. For example, main and _ tmain are somewhat different in the referenced header file. When I encapsulated the program into a service, I found a bunch of errors. After a day, I did not know what the problem was. Finally, Baidu Google finally found the essence of the problem. In a single sentence, "Pay attention to the order in which header files are referenced "! This problem is too big, too small, and difficult to find. Write down this article to tell you that your program has no errors, but please change the order of the referenced H files! For example, the order is as follows:
# Include "stdafx. h"
# Include <winsvc. h>
If it is reversed, the following headaches will occur:

Compiling...
ServerTest. cpp
E:/Project C ++/ServerTest. cpp (58): error C2146: syntax error: ";" missing (before the identifier "hServStatus)
E:/Project C ++/ServerTest. cpp (58): error C2501: "hServStatus": the storage class or type specifier is missing
E:/Project C ++/ServerTest. cpp (59): error C2146: syntax error: ";" missing (before the identifier "hSStat)
E:/Project C ++/ServerTest. cpp (59): error C2501: "hSStat": the storage class or type specifier is missing
E:/Project C ++/ServerTest. cpp (75): error C2065: "SERVICE_TABLE_ENTRY": Undeclared identifier
E:/Project C ++/ServerTest. cpp (75): error C2146: syntax error: ";" missing (before the identifier "DispatchTable)
E:/Project C ++/ServerTest. cpp (75): error C2065: "DispatchTable": Undeclared identifier
E:/Project C ++/ServerTest. cpp (75): error C2059: syntax error: "]"
E:/Project C ++/ServerTest. cpp (75): error C2143: syntax error: ";" missing (before)
E:/Project C ++/ServerTest. cpp (76): error C2143: syntax error: ";" missing (before)
E:/Project C ++/ServerTest. cpp (76): warning C4550: The expression is calculated as a function without a parameter list.
E:/Project C ++/ServerTest. cpp (76): error C2143: syntax error: ";" missing (before)
E:/Project C ++/ServerTest. cpp (77): error C2143: syntax error: ";" missing (before)
E:/Project C ++/ServerTest. cpp (77): error C2143: syntax error: ";" missing (before)
E:/Project C ++/ServerTest. cpp (80): error C3861: "StartServiceCtrlDispatcher": the identifier is not found even if the parameter-related search is used.
E:/Project C ++/ServerTest. cpp (80): error C3861: "DispatchTable": the identifier is not found even if the parameter-related search is used.
E:/Project C ++/ServerTest. cpp (87): error C2065: "SC _HANDLE": Undeclared identifier
E:/Project C ++/ServerTest. cpp (87): error C2146: syntax error: ";" missing (before the identifier "schSCManager)
E:/Project C ++/ServerTest. cpp (87): error C2065: "schSCManager": Undeclared identifier
E:/Project C ++/ServerTest. cpp (88): error C2146: syntax error: ";" missing (before the identifier "schService)
E:/Project C ++/ServerTest. cpp (88): error C3861: "SC _HANDLE": the identifier is not found even if the parameter-related search is used.
E:/Project C ++/ServerTest. cpp (88): error C2065: "schService": Undeclared identifier
E:/Project C ++/ServerTest. cpp (99): error C2065: "SC _MANAGER_ALL_ACCESS": Undeclared identifier
E:/Project C ++/ServerTest. cpp (99): error C3861: "schSCManager": the identifier is not found even if the parameter-related search is used.
E:/Project C ++/ServerTest. cpp (99): error C3861: "OpenSCManager": the identifier is not found even if the parameter-related search is used.
E:/Project C ++/ServerTest. cpp (101): error C3861: "schSCManager": the identifier is not found even if the parameter-related search is used.
......
If the order of reference is correct, your program will be as clear as the prison boss in the third quarter of the prison said: as clear as the blue sky.

 

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.