为什么 std::for_each 不使用 minGW 编译?
Why doesn't std::for_each compile with minGW?
我试图用MinGW编译器在Qt上编译这行,使用QVector<double>
和std::for_each
函数。
std::for_each(data.begin(), data.end(), [max](double& n){ n/=max;});
我得到这个错误:
错误:没有匹配函数调用for_each(QVector::iterator, QVector::iterator, normalize(QVector&)::)'(max) (double&n) {n/= max;});^
在MVSC2013 32位下可以正确编译
我找到了解决方案。你必须使用c++ 11。
使用c++ 11修复。
相关文章:
- 尝试在Windows上执行C++时出错(通过MinGW编译)
- 如何使用mingw编译C STD ::线程代码
- MinGW 编译的可执行文件与网络无法在 x64 系统上运行
- MinGW编译的exe-缺少libgcc_s_silj-1.dll
- 使用由 Mingw 5.3 编译的 boost ASIO 库使用 QT 时出错
- 如何在 Atom IDE 中使用 gpp-compiler 时更改 MinGW 编译的 exe 位置?
- mingw 编译错误:从 'FARPROC ' 到 'void*' 的转换无效,但 msvc 编译正常
- 使用 MinGW 编译具有网络代码的简单 C++ SFML 文件会引发错误"undefined reference to IpAddress"
- 使用 mingw 编译 opencv3.1
- libx264用mingw编译 - 缺少__umoddi3,__udivdi3,_fseeko64和____chkstk
- MinGW .h 编译文件不起作用:此文件的版本与您运行的 Windows 版本不兼容
- 尝试使用 MinGW 编译 Assembly + C++:ccqKAvXJ.o:main.cpp:(.text+0x18):对 'GetMagicNumber' 的未定义引用
- std::endl 导致使用 MinGW 编译的 Windows 8 崩溃
- 用mingw编译SDL2,使用崇高的文本2错误
- MinGW编译失败:我创建的头文件没有这样的文件或目录
- 获取记事本++以使用minGW编译和运行C++程序
- 使用小型转储和 GDB 分析崩溃,以便 mingw 编译的可执行文件
- 使用 MinGW 编译自动化代理
- 无法在Win7上使用MinGW编译RIES。
- Qt5:此代码使用msvc2012编译正常,但使用MinGW编译时出现错误..为什么?