QtCreator构建系统在OSX升级后损坏
QtCreator build system is broken after OSX upgrade
我最近将我的OSX升级到了mountain lion,从那以后我就不能再使用Qt Creator编译我的项目了。我得到一堆错误如下:
/Users/user/codes/lib/io/xdmfWriter.cpp:63: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available
/Users/user/codes/lib/io/xdmfWriter.cpp:-1: In instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
/Users/user/codes/lib/io/xdmfWriter.cpp:63: instantiated from here
// xdmfWriter.cpp -- line 63:
gridName << xdmfName_ << "." << timeStep;
gridName
是std::ostringstream
对象,xdmfName_
是声明为xdmfWriter
类的私有成员并在类构造函数中初始化的std::string
变量。我以前没有这个问题。。。有什么想法吗?
这可以通过在中添加c_str()
来修复
gridName << xdmfName_.c_str() << "." << timeStep;
然而,这并不是一个永久性的解决方案。
更新:我在中找到了解决方案https://web.archive.org/web/20140809210004/http://qt-project.org/forums/viewthread/11106/P15
您需要将$QTDIR/mkspecs/common/g++-macx.conf
中的-mmacosx-version-min=10.5
更改为-mmacosx-version-min=10.7
。这是因为Mountain Lion和XCode 4.4中不包含10.5或10.6的SDK。
我已经尝试更改g++-macx.conf文件,但仍然出现错误。我发现使用:
QMAKE_CXXFLAGS += -fpermissive
在我的专业档案上做到了。
听起来如果我使用Clang
工具链(强制使用clang++
而不是llvm-g++
),我就没有这个问题。。。
- 为什么会发生堆损坏
- 具有奇怪重复模板模式的派生类中的成员变量已损坏
- 平均图像时图像损坏
- 如何针对特定情况调试和修复此双自由内存损坏问题
- OSX MetalKit CVMetalTextureCacheCreateTextureFromImage失败,状态:
- 为什么C中的通用链表中存储的数据已损坏
- gdb错误:Backtrace已停止:上一帧与此帧相同(堆栈已损坏?)
- C++双重释放或损坏(out)
- 捕获标准输出以压缩并使用 CTRL-C 中断会给出损坏的 zip 文件
- OSX蓝牙打开RFCOMMChannelAsync声称已连接,但未建立连接,并且从未调用过委托
- 使用全局声明的向量时,C++双重释放错误/损坏
- 在OSX上使用CMake将Adobe的XMP工具包构建为共享库的最简单方法是什么?
- 变量周围的堆栈'...'已损坏
- 运行时检查失败 #2 变量"A"周围的堆栈已损坏
- C ++是否有C ++ 17 OSX 10.13.6的标志
- 各种版本的 Mac OSX 向后兼容性如何?(Xcode C++
- 检测到堆损坏:在正常块 c++ 动态 2D 数组之后
- OSX "ld" : 如何显示未解析符号的损坏名称?如何获取地图文件?
- QtCreator构建系统在OSX升级后损坏
- 在OSX + llvm/libc++上内存损坏/结构重排序