Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtCreator build system is broken after OSX upgrade

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 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 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?

like image 325
mmirzadeh Avatar asked Aug 01 '12 17:08

mmirzadeh


2 Answers

This can be fixed by adding a c_str() as in:

gridName << xdmfName_.c_str() << "." << timeStep;

However, this is not a permanent solution.

Update: I found the solution in https://web.archive.org/web/20140809210004/http://qt-project.org/forums/viewthread/19106/P15

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.

like image 199
sordid Avatar answered Sep 19 '22 16:09

sordid


I have tried changing the g++-macx.conf fila but I was still getting the errors. I found that using:

QMAKE_CXXFLAGS += -fpermissive

on my pro file did the trick.

like image 33
wotaskd Avatar answered Sep 23 '22 16:09

wotaskd