QtCreator构建系统在OSX升级后损坏 [英] QtCreator build system is broken after OSX upgrade
问题描述
我最近将OSX升级为山狮,因为我无法使用Qt Creator编译我的项目。我收到一堆错误,如下所示:
I recently upgraded my OSX to mountain lion and ever since I cannot compile my project using Qt Creator anymore. I get bunch of errors like the following:
/Users/user/codes/lib/io/xdmfWriter.cpp:63:error:explicit 'std :: basic_ostream< _CharT,_Traits>& std :: operator<<<<(std :: basic_ostream< _CharT,_Traits>& const std :: basic_string< _CharT,_Traits,_Alloc>& ,_Alloc = std :: allocator< char>]'但没有可用的定义
/ Users / user / codes /lib/io/xdmfWriter.cpp:-1:在实例化'std :: basic_ostream< _CharT,_Traits>& std :: operator<<<<(std :: basic_ostream< _CharT,_Traits>& const std :: basic_string< _CharT,_Traits,_Alloc>& ,_Alloc = std :: allocator< char>]':
/ Users / user / codes / io / xdmfWriter.cpp:63:从这里实例化
// xdmfWriter.cpp -- line 63:
gridName << xdmfName_ << "." << timeStep;
gridName
是 std :: ostringstream
对象和 xdmfName _
是一个 std :: string
类的 xdmfWriter
类的私有成员,并在类构造函数中初始化。我之前没有这个问题...任何想法?
gridName
is a std::ostringstream
object and xdmfName_
is a std::string
variable declared as a private member of the xdmfWriter
class and initialized in the class constructor. I did not have this problem before ... Any ideas?
推荐答案
这可以通过添加 c_str()
如:
gridName << xdmfName_.c_str() << "." << timeStep;
但是,这不是永久的解决方案。
However, this is not a permanent solution.
更新:我在 https://web.archive.org/web/20140809210004/http://qt-project.org/forums/viewthread/19106/P15
您需要更改 $ QTDIR / mkspecs / common / g ++中的
至 -mmacosx-version-min = 10.5
-macx.conf -mmacosx-version-min = 10.7
。
这是因为10.5或10.6的SDK不包括在Mountain Lion和XCode 4.4中。
You need to change -mmacosx-version-min=10.5
in $QTDIR/mkspecs/common/g++-macx.conf
to -mmacosx-version-min=10.7
.
This is because SDKs for 10.5 or 10.6 are not included in Mountain Lion and XCode 4.4.
这篇关于QtCreator构建系统在OSX升级后损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!