'function': was declared deprecated

本文介绍了如何解决C++编译器产生的警告C4996,包括消除方法、警告产生的原因及解决方案。通过定义预处理器宏、使用编译器选项或警告指令等方式来禁用或抑制此警告。
http://blog.youkuaiyun.com/is2120/article/details/7208770
1. 警告消息 'function': was declared deprecated
Compiler Warning (level 1) C4996

Error Message
'function': was declared deprecated

The compiler encountered a function that was marked with deprecated. The function may no longer be supported in a future release. You can turn this warning off with thewarning pragma (example below).

C4996 is generated for the line on which the function is declared and for the line on which the function is used.

You will see C4996 if you are using members of the <hash_map> and <hash_set> header files in the std namespace. SeeThe stdext Namespace for more information.

Some CRT and Standard C++ Library functions have been deprecated in favor of new, more secure functions. For more information on deprecated functions, seeSecurity Enhancements in the CRT andSafe Libraries: Standard C++ Library.

C4996 can also occur if you use MFC or ATL functions that were deprecated for security reasons. To suppress these warnings, see_AFX_SECURE_NO_WARNINGS and_ATL_SECURE_NO_WARNINGS.

Example//z 2012-1-18 11:29 AM IS2120@优快云

The following sample generates C4996.

// C4996.cpp
// compile with: /W1
// C4996 warning expected
#include <stdio.h>

// #pragma warning(disable : 4996)
void func1(void) {
   printf_s("\nIn func1");
}

__declspec(deprecated) void func1(int) {
   printf_s("\nIn func2");
}

int main() {
   func1();
   func1(1);
}

C4996 can also occur if you do not use a checked iterator when compiling with _SECURE_SCL 1. SeeChecked Iterators for more information.

The following sample generates C4996.

// C4996_b.cpp
// compile with: /EHsc /W1
#define _SECURE_SCL 1
#include <algorithm>
using namespace std;
using namespace stdext;
int main() {
   int a [] = {1, 2, 3};
   int b [] = {10, 11, 12};
   copy(a, a + 3, b);   // C4996
   copy(a, a + 3, checked_array_iterator<int *>(b, 3));   // OK
}
//z 2012-1-18 11:29 AM IS2120@优快云
2. 消除的几种方法(不建议正式的项目中使用,只是用于自己做的一些小工具项目)
_SCL_SECURE_NO_WARNINGS 

Calling any one of the potentially unsafe methods in the Standard C++ Library will result inCompiler Warning (level 1) C4996. To disable this warning, define the macro_SCL_SECURE_NO_WARNINGS in your code:

2.1 #define _SCL_SECURE_NO_WARNINGS

Other ways to disable warning C4996 include:

  • 2.2 Using the /D (Preprocessor Definitions)compiler option:

    cl /D_SCL_SECURE_NO_WARNINGS [other compiler options] myfile.cpp
  • 2.3 Using the /w compiler option:

    cl /wd4996 [other compiler options] myfile.cpp
  • 2.4 Using the #pragma warning directive:

    #pragma warning(disable:4996)

Also, you can manually change the level of warning C4996 with the /w<l><n> compiler option. For example, to set warning C4996 to level 4:

2.5 cl /w44996 [other compiler options] myfile.cpp
//z 2012-1-18 11:29 AM IS2120@优快云
http://blog.youkuaiyun.com/is2120/article/details/7208770

3. 遇到一个链接错误 unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
The symbol is defined in msvcrt.lib. You are not linking with that library because you specified the /NODEFAULTLIB linker option. Either remove that option, or add msvcrt.lib as an input library. Thanks for taking the time to report this!

Mitchell Slep
Visual C++ Compiler Team

RTTI is on by default in Visual C++ 2005, so you need to explicitly disable it by adding /GR- to the command line.

Thank you,

Dean Wills
Visual C++ Team

转载于:https://www.cnblogs.com/IS2120/archive/2012/01/18/6745954.html

home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:41:41: error: ‘AV_PIX_FMT_VDPAU_MPEG4’ was not declared in this scope; did you mean ‘AV_PIX_FMT_VDPAU’? 41 | # define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt; | ^~~~~~~~~~~ /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:41:41: note: in definition of macro ‘TEST_PIX_FMT_RETURN’ 41 | # define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt; | ^~~~~~~~~~~ /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp: In member function ‘void pangolin::FfmpegVideo::InitUrl(std::string, std::string, std::string, bool, int)’: /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:148:21: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations] 148 | av_register_all(); | ^ In file included from /home/gc/Pangolin/include/pangolin/video/drivers/ffmpeg.h:43, from /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:28: /usr/local/include/libavformat/avformat.h:2050:6: note: declared here 2050 | void av_register_all(void); | ^~~~~~~~~~~~~~~ /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:148:21: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations] 148 | av_register_all(); | ^ In file included from /home/gc/Pangolin/include/pangolin/video/drivers/ffmpeg.h:43, from /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:28: /usr/local/include/libavformat/avformat.h:2050:6: note: declared here 2050 | void av_register_all(void); | ^~~~~~~~~~~~~~~ /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:199:36: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] 199 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) | ^~~~~ In file included from /home/gc/Pangolin/include/pangolin/video/drivers/ffmpeg.h:43, from /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:28: /usr/local/include/libavformat/avformat.h:880:21: note: declared here 880 | AVCodecContext *codec; | ^~~~~ /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:199:36: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] 199 | if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) | ^~~~~ In file included from /home/gc/Pangolin/include/pangolin/video/drivers/ffmpeg.h:43, from /home/gc/Pangolin/src/video/drivers/ffmpeg.cpp:28: /usr/local/include/libavformat/avformat.h:880:21: note: declared here
03-29
13:46:32: 为项目MainWindowExample执行步骤 ... 13:46:32: 配置没有改变, 跳过 qmake 步骤。 13:46:32: 正在启动 "D:\Qt5.14.2\Tools\mingw730_64\bin\mingw32-make.exe" -j12 D:/Qt5.14.2/Tools/mingw730_64/bin/mingw32-make -f Makefile.Release mingw32-make[1]: Entering directory 'D:/Work/laoliu/cds/resource/build-MainWindowExample-Desktop_Qt_5_14_2_MinGW_64_bit-Release' Makefile.Release:2822: warning: overriding recipe for target 'release/moc_imageexportthread.cpp' Makefile.Release:2590: warning: ignoring old recipe for target 'release/moc_imageexportthread.cpp' Makefile.Release:4394: warning: overriding recipe for target 'release/moc_OpenWordtemplate.cpp' Makefile.Release:4280: warning: ignoring old recipe for target 'release/moc_OpenWordtemplate.cpp' Makefile.Release:20869: warning: overriding recipe for target 'release/imageexportthread.o' Makefile.Release:11270: warning: ignoring old recipe for target 'release/imageexportthread.o' g++ -c -fno-keep-inline-dllexport -DQT_USE_FFMPEG -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_SVG_LIB -DQT_AXCONTAINER_LIB -DQT_AXBASE_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\MainWindowExample -I. -I..\MainWindowExample\GL_LIB -I..\MainWindowExample\include -I..\Ribbon\include -I..\MainWindowExample\quazip\include -I..\opencv\include -I..\MainWindowExample\deps\glm32\include -I..\MainWindowExample\deps\freetype32\include\freetype2 -ID:\Qt5.14.2\5.14.2\mingw73_64\include -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimediaWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimedia -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSvg -ID:\Qt5.14.2\5.14.2\mingw73_64\include\ActiveQt -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtPrintSupport -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtGui -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtANGLE -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtNetwork -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSql -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtXml -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtConcurrent -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtCore -Irelease -ID:\VulkanSDK\1.3.283.0\include -ID:\Qt5.14.2\5.14.2\mingw73_64\mkspecs\win32-g++ -o release\main.o ..\MainWindowExample\main.cpp g++ -c -fno-keep-inline-dllexport -DQT_USE_FFMPEG -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_SVG_LIB -DQT_AXCONTAINER_LIB -DQT_AXBASE_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\MainWindowExample -I. -I..\MainWindowExample\GL_LIB -I..\MainWindowExample\include -I..\Ribbon\include -I..\MainWindowExample\quazip\include -I..\opencv\include -I..\MainWindowExample\deps\glm32\include -I..\MainWindowExample\deps\freetype32\include\freetype2 -ID:\Qt5.14.2\5.14.2\mingw73_64\include -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimediaWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimedia -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSvg -ID:\Qt5.14.2\5.14.2\mingw73_64\include\ActiveQt -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtPrintSupport -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtGui -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtANGLE -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtNetwork -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSql -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtXml -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtConcurrent -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtCore -Irelease -ID:\VulkanSDK\1.3.283.0\include -ID:\Qt5.14.2\5.14.2\mingw73_64\mkspecs\win32-g++ -o release\imageexportthread.o ..\MainWindowExample\Custom\module\imageexportthread.cpp g++ -c -fno-keep-inline-dllexport -DQT_USE_FFMPEG -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_SVG_LIB -DQT_AXCONTAINER_LIB -DQT_AXBASE_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\MainWindowExample -I. -I..\MainWindowExample\GL_LIB -I..\MainWindowExample\include -I..\Ribbon\include -I..\MainWindowExample\quazip\include -I..\opencv\include -I..\MainWindowExample\deps\glm32\include -I..\MainWindowExample\deps\freetype32\include\freetype2 -ID:\Qt5.14.2\5.14.2\mingw73_64\include -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimediaWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimedia -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSvg -ID:\Qt5.14.2\5.14.2\mingw73_64\include\ActiveQt -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtPrintSupport -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtGui -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtANGLE -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtNetwork -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSql -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtXml -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtConcurrent -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtCore -Irelease -ID:\VulkanSDK\1.3.283.0\include -ID:\Qt5.14.2\5.14.2\mingw73_64\mkspecs\win32-g++ -o release\helpdialog.o ..\MainWindowExample\helpdialog.cpp In file included from ..\MainWindowExample/datamagr.h:13:0, from ..\MainWindowExample\Custom\module\imageexportthread.cpp:2: ..\MainWindowExample/dataexportmagr.h: In function 'float normalize360Angle(float)': ..\MainWindowExample/dataexportmagr.h:101:17: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample/dataexportmagr.h:101:17: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof ..\MainWindowExample/dataexportmagr.h:101:12: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample/dataexportmagr.h:101:12: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof g++ -c -fno-keep-inline-dllexport -DQT_USE_FFMPEG -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_SVG_LIB -DQT_AXCONTAINER_LIB -DQT_AXBASE_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\MainWindowExample -I. -I..\MainWindowExample\GL_LIB -I..\MainWindowExample\include -I..\Ribbon\include -I..\MainWindowExample\quazip\include -I..\opencv\include -I..\MainWindowExample\deps\glm32\include -I..\MainWindowExample\deps\freetype32\include\freetype2 -ID:\Qt5.14.2\5.14.2\mingw73_64\include -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimediaWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtMultimedia -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSvg -ID:\Qt5.14.2\5.14.2\mingw73_64\include\ActiveQt -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtPrintSupport -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtGui -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtANGLE -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtNetwork -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtSql -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtXml -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtConcurrent -ID:\Qt5.14.2\5.14.2\mingw73_64\include\QtCore -Irelease -ID:\VulkanSDK\1.3.283.0\include -ID:\Qt5.14.2\5.14.2\mingw73_64\mkspecs\win32-g++ -o release\mainwindow.o ..\MainWindowExample\mainwindow.cpp In file included from ..\MainWindowExample\datamagr.h:13:0, from ..\MainWindowExample\ioperation.h:6, from ..\MainWindowExample\mainwindow.h:4, from ..\MainWindowExample\main.cpp:1: ..\MainWindowExample\dataexportmagr.h: In function 'float normalize360Angle(float)': ..\MainWindowExample\dataexportmagr.h:101:17: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:17: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof ..\MainWindowExample\dataexportmagr.h:101:12: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:12: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof In file included from ..\MainWindowExample\mainwindow.h:4:0, from ..\MainWindowExample\main.cpp:1: ..\MainWindowExample\ioperation.h: In member function 'float IOpration::GetOffSet(float, float)': ..\MainWindowExample\ioperation.h:41:24: error: 'fabsf' was not declared in this scope float offset = fabsf(fMax - fMin); ^~~~~ ..\MainWindowExample\ioperation.h:41:24: note: suggested alternative: 'labs' float offset = fabsf(fMax - fMin); ^~~~~ labs In file included from ..\MainWindowExample\datamagr.h:13:0, from ..\MainWindowExample\helpdialog.h:6, from ..\MainWindowExample\helpdialog.cpp:1: ..\MainWindowExample\dataexportmagr.h: In function 'float normalize360Angle(float)': ..\MainWindowExample\dataexportmagr.h:101:17: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:17: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof ..\MainWindowExample\dataexportmagr.h:101:12: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:12: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof mingw32-make[1]: *** [Makefile.Release:20869: release/imageexportthread.o] Error 1 mingw32-make[1]: *** Waiting for unfinished jobs.... mingw32-make[1]: *** [Makefile.Release:12364: release/helpdialog.o] Error 1 ..\MainWindowExample\main.cpp: In function 'int qMain(int, char**)': ..\MainWindowExample\main.cpp:57:54: warning: 'const QRect QDesktopWidget::screenGeometry(int) const' is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] QRect screenRect = desktopWidget->screenGeometry(); ^ In file included from D:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets/QDesktopWidget:1:0, from ..\MainWindowExample\main.cpp:8: D:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets/qdesktopwidget.h:79:67: note: declared here QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect screenGeometry(int screen = -1) const; ^~~~~~~~~~~~~~ ..\MainWindowExample\main.cpp:86:61: warning: 'const QRect QDesktopWidget::availableGeometry(int) const' is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] QRect screenGeometry = desktopWidget->availableGeometry(); ^ In file included from D:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets/QDesktopWidget:1:0, from ..\MainWindowExample\main.cpp:8: D:\Qt5.14.2\5.14.2\mingw73_64\include\QtWidgets/qdesktopwidget.h:88:67: note: declared here QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect availableGeometry(int screen = -1) const; ^~~~~~~~~~~~~~~~~ mingw32-make[1]: *** [Makefile.Release:10858: release/main.o] Error 1 In file included from ..\MainWindowExample\datamagr.h:13:0, from ..\MainWindowExample\ioperation.h:6, from ..\MainWindowExample\mainwindow.h:4, from ..\MainWindowExample\mainwindow.cpp:1: ..\MainWindowExample\dataexportmagr.h: In function 'float normalize360Angle(float)': ..\MainWindowExample\dataexportmagr.h:101:17: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:17: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof ..\MainWindowExample\dataexportmagr.h:101:12: error: 'fmod' was not declared in this scope return fmod(fmod(angle, 360) + 360, 360); ^~~~ ..\MainWindowExample\dataexportmagr.h:101:12: note: suggested alternative: 'feof' return fmod(fmod(angle, 360) + 360, 360); ^~~~ feof In file included from ..\MainWindowExample\mainwindow.h:4:0, from ..\MainWindowExample\mainwindow.cpp:1: ..\MainWindowExample\ioperation.h: In member function 'float IOpration::GetOffSet(float, float)': ..\MainWindowExample\ioperation.h:41:24: error: 'fabsf' was not declared in this scope float offset = fabsf(fMax - fMin); ^~~~~ ..\MainWindowExample\ioperation.h:41:24: note: suggested alternative: 'labs' float offset = fabsf(fMax - fMin); ^~~~~ labs ..\MainWindowExample\mainwindow.cpp: In member function 'void MainWindow::onFileImportData()': ..\MainWindowExample\mainwindow.cpp:1231:42: warning: 'QDateTime QFileInfo::created() const' is deprecated: Use either birthTime() or metadataChangeTime() [-Wdeprecated-declarations] QDateTime created = fileInfo.created(); // 鍒涘缓鏃堕棿 ^ In file included from D:\Qt5.14.2\5.14.2\mingw73_64\include/QtCore/qdir.h:44:0, from D:\Qt5.14.2\5.14.2\mingw73_64\include/QtCore/QtCore:64, from D:\Qt5.14.2\5.14.2\mingw73_64\include/QtConcurrent/QtConcurrentDepends:3, from D:\Qt5.14.2\5.14.2\mingw73_64\include\QtConcurrent/QtConcurrent:3, from ..\MainWindowExample\mainwindow.h:7, from ..\MainWindowExample\mainwindow.cpp:1: D:\Qt5.14.2\5.14.2\mingw73_64\include/QtCore/qfileinfo.h:138:15: note: declared here QDateTime created() const; ^~~~~~~ mingw32-make[1]: *** [Makefile.Release:13284: release/mainwindow.o] Error 1 mingw32-make[1]: Leaving directory 'D:/Work/laoliu/cds/resource/build-MainWindowExample-Desktop_Qt_5_14_2_MinGW_64_bit-Release' mingw32-make: *** [Makefile:45: release] Error 2 13:46:41: 进程"D:\Qt5.14.2\Tools\mingw730_64\bin\mingw32-make.exe"退出,退出代码 2 。 Error while building/deploying project MainWindowExample (kit: Desktop Qt 5.14.2 MinGW 64-bit) When executing step "Make"
最新发布
11-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值