我正在尝试在Appveyor上传递我的构建,但我遇到了编译问题。
给定以下简单的Qt项目:
// ConsoleTest.pro
QT += core
QT -= gui
TARGET = ConsoleTest02
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
CONFIG += c++11
和源代码:
// main.cpp
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
我有以下错误:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
from ../../Qt/5.4/mingw491_32/include/QtCore/qglobal.h:81,
from ../../Qt/5.4/mingw491_32/include/QtCore/qcoreapplication.h:37,
from ../../Qt/5.4/mingw491_32/include/QtCore/QCoreApplication:1,
from ConsoleTest02/main.cpp:1:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
{ return (float)(_hypot (x, y)); }
^
如果我从ConsoleTest.pro中删除以下行,错误就会消失:
CONFIG += c++11
我正在使用Qt 5.4和MinGW 4.9.1 32 bit。
任何想法?