1>------ Build started: Project: Record, Configuration: Debug Win32 ------
1>Build started 2011-5-4 13:38:49.
1>InitializeBuildStatus:
1> Touching ".\Debug\Record.unsuccessfulbuild".
1>ClCompile:
1> StdAfx.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228): error C2143: syntax error : missing ';' before '}'
1>c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2365: 'printf' : redefinition; previous definition was 'data variable'
1> c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228) : see declaration of 'printf'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.73
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========没有少";",找了半天不知道什么原因
1>Build started 2011-5-4 13:38:49.
1>InitializeBuildStatus:
1> Touching ".\Debug\Record.unsuccessfulbuild".
1>ClCompile:
1> StdAfx.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228): error C2143: syntax error : missing ';' before '}'
1>c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2365: 'printf' : redefinition; previous definition was 'data variable'
1> c:\program files\microsoft visual studio 10.0\vc\include\tchar.h(1228) : see declaration of 'printf'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.73
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========没有少";",找了半天不知道什么原因
解决方案 »
- vc++ 算法解三元二次方程
- 程序启动后如何让它显示在屏幕正中间
- 在vc中使用ado,有没有配套的文档呢
- vc的一个问题
- 帮你高质高效并舒适地编程的工具:Visual Unit发布,试用获赠正式版!
- 我在用DAO时,选择数据库那一步(step2 of 6) ,选择数据库后,OK时,为什么 提示一个错误(Unrecognize Database format "数据库路径")
- 旋转按钮控件在设置Set buddy integer后出现Debug Assertion Failed!错误!
- 请问怎样把rect和rect中的内容一起旋转90度
- 怎样使listbox和ComboBox的各个条目具有不同的颜色
- 二值图像处理
- 大量数据频繁写,如何效率高?
- 静态文本框的长度不够!
------------------------------
未定义的标识符吧?是不是没有include相关的头文件呢?
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
在弹出对话框的左侧找到“配置属性”点击‘常规“,在到右边找到”字符集“,
点击后面选择”使用UNICODE字符符集“。
对应英文为properties->Configuration Properties->General->Character Set
1>------ Build started: Project: Record, Configuration: Debug Win32 ------
1>Build started 2011-5-4 15:25:18.
1>InitializeBuildStatus:
1> Touching ".\Debug\Record.unsuccessfulbuild".
1>ClCompile:
1> StdAfx.cpp
1> RecordDlg.cpp
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(149): error C2664: 'CComboBox::InsertString' : cannot convert parameter 2 from 'char *' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(212): error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6655): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6657): or 'int AfxMessageBox(UINT,UINT,UINT)'
1> while trying to match the argument list '(char [400], long, int)'
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(218): error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6655): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6657): or 'int AfxMessageBox(UINT,UINT,UINT)'
1> while trying to match the argument list '(char [400], long, int)'
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(235): error C2440: '=' : cannot convert from 'const char [5]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(240): error C2440: '=' : cannot convert from 'const char [9]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(245): error C2440: '=' : cannot convert from 'const char [9]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(250): error C2440: '=' : cannot convert from 'const char [7]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(255): error C2440: '=' : cannot convert from 'const char [9]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(260): error C2440: '=' : cannot convert from 'const char [7]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(265): error C2440: '=' : cannot convert from 'const char [9]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(270): error C2440: '=' : cannot convert from 'const char [9]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(278): error C2664: 'int CListCtrl::InsertItem(int,LPCTSTR)' : cannot convert parameter 2 from 'char *' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(325): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [30]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(335): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [30]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(341): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [30]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(343): error C2664: 'CListCtrl::SetItemText' : cannot convert parameter 3 from 'const char [2]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(346): error C2664: 'CListCtrl::SetItemText' : cannot convert parameter 3 from 'const char [1]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(354): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [30]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(359): error C2664: 'wsprintfW' : cannot convert parameter 1 from 'char [600]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(362): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [600]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(364): error C2664: 'CListCtrl::SetItemText' : cannot convert parameter 3 from 'char [600]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(368): error C2664: 'wsprintfW' : cannot convert parameter 1 from 'char [100]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(369): error C2664: 'wsprintfW' : cannot convert parameter 1 from 'char [100]' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(370): error C2664: 'CListCtrl::SetItemText' : cannot convert parameter 3 from 'char [100]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(373): error C2664: 'int CListCtrl::GetItemText(int,int,LPTSTR,int) const' : cannot convert parameter 3 from 'char [30]' to 'LPTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(436): error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6655): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6657): or 'int AfxMessageBox(UINT,UINT,UINT)'
1> while trying to match the argument list '(char [200], long, int)'
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(444): error C2664: 'SsmGetLastErrMsg' : cannot convert parameter 1 from 'wchar_t *' to 'LPSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\my documents\desktop\vc-sw\recorddlg.cpp(457): error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6655): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'
1> c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(6657): or 'int AfxMessageBox(UINT,UINT,UINT)'
1> while trying to match the argument list '(char [200], long, int)'
1> Generating Code...
1> Skipping... (no relevant changes detected)
1> Record.cpp
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:02.95
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
这里提供一个方法
工程属性的Properties/C/C++, 选择 Preprocessor.
原来设定可能有这样的东西
WIN32;_DEBUG;_WINDOWS;(PreprocessorDefinitions)
加上WINVER=0x0501,也就类似下面的
WIN32;_DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)解释VS2010默认是Windows7
下面那个加上以后Windows7和WindowsXP都可以运行