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.   

    没有少";",找了半天不知道什么原因
    ------------------------------
    未定义的标识符吧?是不是没有include相关的头文件呢?
      

  2.   

    tchar.h   怎么错误在这里面 这是系统的头文件啊
      

  3.   

    需要定义一下windows的版本#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.                   
    #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
    #endif
      

  4.   

    unicode的工程吧!查看保证使用unicode版本的函数。
      

  5.   

    也可能是你文件include的顺序不对造成的
      

  6.   

    你的cpp中头文件等是否包含正确
      

  7.   

    工程的属性 有一个字符集的设置,设为unicode以及非unicode 都试一下。
      

  8.   

    打开工程 ,选择你的“解决方案”下的工程名 ,右击 在弹出窗口选择“属性”,
    在弹出对话框的左侧找到“配置属性”点击‘常规“,在到右边找到”字符集“,
    点击后面选择”使用UNICODE字符符集“。
    对应英文为properties->Configuration Properties->General->Character Set
      

  9.   

    改了  可是改过之后出现一大堆的错误
    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 ==========
      

  10.   

    估计搂主早就解决了。
    这里提供一个方法
    工程属性的Properties/C/C++, 选择 Preprocessor. 
    原来设定可能有这样的东西
    WIN32;_DEBUG;_WINDOWS;(PreprocessorDefinitions)
    加上WINVER=0x0501,也就类似下面的
    WIN32;_DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)解释VS2010默认是Windows7
    下面那个加上以后Windows7和WindowsXP都可以运行