C++常见错误:
1. C2146错误通常原因是变量定义前的类型说明符找不到,可能因为拼写错误或未加入需要的头文件引用导致
2. Error 1 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? c:\documents and settings\aldous.liu\桌面\myservice1\myservice1\firstservice.cpp 170 FirstService
属*->C/C++->Precompiled Headers->Create/Use Precompiled Headers->Not Using Precompiled Headers
3. Error 1 error C2440: 'initializing' : cannot convert from 'const char [9]' to 'LPWSTR' c:\documents and settings\aldous.liu\桌面\ntservice2\ntservice2\ntservice2.cpp 13 NTService2
属*->General->Use Multi-Byte Character Set
4. Error 1 error C2065: 'ServiceMain' : undeclared identifier c:\documents and settings\aldous.liu\桌面\ntservice2\ntservice2\ntservice2.cpp 13 NTService2
将方法、变量的定义移到最先使用此方法、变量之前
2. Error 1 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? c:\documents and settings\aldous.liu\桌面\myservice1\myservice1\firstservice.cpp 170 FirstService
属*->C/C++->Precompiled Headers->Create/Use Precompiled Headers->Not Using Precompiled Headers
3. Error 1 error C2440: 'initializing' : cannot convert from 'const char [9]' to 'LPWSTR' c:\documents and settings\aldous.liu\桌面\ntservice2\ntservice2\ntservice2.cpp 13 NTService2
属*->General->Use Multi-Byte Character Set
4. Error 1 error C2065: 'ServiceMain' : undeclared identifier c:\documents and settings\aldous.liu\桌面\ntservice2\ntservice2\ntservice2.cpp 13 NTService2
将方法、变量的定义移到最先使用此方法、变量之前