要禁用弃用,请使用_CRT_SECURE_NO_WARNINGS。详情请参见在线帮助

时间:2013-09-27 15:25:04

标签: qt visual-studio-2008

我是Qt的新手。我有一个供应商给出的应用程序,我正在尝试构建我的应用程序,

我收到以下错误,我花了好几个小时来解决这个错误, 我提到的解决方案似乎都没有解决我的问题

moc_mainwindow.cpp

e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(268) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(270) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(311) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'
e:\installed softwares\msvc2008\vc\include\xsens\xsexception.h(48) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'
moc_myxda.cpp
sktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\awindamonitor" -I"." -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -D_MSC_VER=1500 -DWIN32 ..\awindamonitor\measurementstarter.h -o debug\moc_measurementstarter.cpp
    e:\MoCap\QT\Desktop\Qt\4.8.1\msvc2008\bin\rcc.exe -name awindamonitor ..\awindamonitor\awindamonitor.qrc -o debug\qrc_awindamonitor.cpp
    rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -fo debug\icon.res ..\awindamonitor\icon.rc
    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include" -I"E:\MoCap\MTW SDK 4.1.5\GUI\awindamonitor\..\..\Win32\include" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\awindamonitor" -I"." -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\Users\ASUS\AppData\Local\Temp\moc_mainwindow.obj.5008.546.jom
    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include" -I"E:\MoCap\MTW SDK 4.1.5\GUI\awindamonitor\..\..\Win32\include" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\awindamonitor" -I"." -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\Users\ASUS\AppData\Local\Temp\moc_myxda.obj.5008.3261.jom
connectedmtwdata.cpp
measurementstarter.cpp
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(268) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(270) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(311) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'
Generating Code...
    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include" -I"E:\MoCap\MTW SDK 4.1.5\GUI\awindamonitor\..\..\Win32\include" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\awindamonitor" -I"." -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\Users\ASUS\AppData\Local\Temp\moc_measurementstarter.obj.5008.3261.jom
myxda.cpp
serialkey.cpp
Generating Code...
    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_        1 file(s) copied.
        1 file(s) copied.
The system cannot find the path specified.
MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include" -I"E:\MoCap\MTW SDK 4.1.5\GUI\awindamonitor\..\..\Win32\include" -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\awindamonitor" -I"." -I"..\..\..\QT\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\Users\ASUS\AppData\Local\Temp\qrc_awindamonitor.obj.5008.4134.jom
qrc_awindamonitor.cpp
moc_measurementstarter.cpp
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(268) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(270) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(311) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'
main.cpp
mainwindow.cpp
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(268) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(270) : warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdlib.h(499) : see declaration of 'mbstowcs'
e:\installed softwares\msvc2008\vc\include\xsens\xsstring.h(311) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'
e:\installed softwares\msvc2008\vc\include\xsens\xsexception.h(48) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        E:\Installed Softwares\MSVC2008\VC\INCLUDE\stdio.h(366) : see declaration of 'sprintf'

1 个答案:

答案 0 :(得分:0)

-D _CRT_SECURE_NO_WARNINGS添加到编译器标志中以避免第三方库代码(例如Qt)中的警告。

如果您控制的代码是警告的来源,请解决问题。警告告诉您确切要做什么。

通过调用sprintf等来取代对sprintf_s的来电。