[SOLVED] qtCreator doesn’t build my project since I update to Mountain Lion

Page  
2

July 27, 2012

rikytres rikytres
Lab Rat
29 posts

In particular the compiler give this error three times at the same row’s code…

/Users/TresMac/Developing Project/C++/CalcolatriceSensibile-build-desktop-Desktop_Qt_4_7_4_for_GCC__Qt_SDK__Debug/../CalcolatriceSensibile/mainTest.cpp:16: 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

July 28, 2012

rikytres rikytres
Lab Rat
29 posts

I found that tis problem come out when i use the operator << with cout on a std:.string variable.

For exemple this code give mi problems:

  1. #include<string>
  2. #include<iostream>
  3. std::string exemple = "exemple";
  4. std::cout<<exemple;

July 29, 2012

zetavision zetavision
Lab Rat
3 posts

I have the same operator << problem. Does Anyone know how to solve it?

July 29, 2012

garrgravarr garrgravarr
Lab Rat
2 posts

Yes!!

I had the same problem with the “explicit instantiation of ‘std:basic_ostream<..’”

I tried out the flags that Qt used to compile a simple main routine. Seems it works if you say -mmacosx-version-min=10.7
instead of -mmacosx-version-min=10.5

There are no sdks for 10.5 or 10.6 on Mountain Lion and XCode 4.4!

Hope that helped.

cheers, tim

July 29, 2012

garrgravarr garrgravarr
Lab Rat
2 posts

btw, the entries with

-mmacosx-version-min=10.5

can be found in

$QTDIR/mkspecs/common/g++-macx.conf

.

cheers again…

July 29, 2012

zetavision zetavision
Lab Rat
3 posts

Great! I just found that conf. It works now. Thanks a lot. :)

July 29, 2012

rikytres rikytres
Lab Rat
29 posts

Perfect!! Now it works!!
Thanks a lot!

July 31, 2012

gosuperninja gosuperninja
Lab Rat
10 posts

Changing the mkspec file to -mmacosx-version-min=10.5 worked for me.

This one was real obscure. Does anyone have reason why this would break std iostream functions? At first I thought it was change in the gcc version with Mountain Lion.

Also, this appears to only effect gcc. Clang doesn’t seem to have a problem with min-version is seto to 10.5

July 31, 2012

Tobias Hunger Tobias Hunger
Mad Scientist
3125 posts

Did you guys file a bug report [bugreports.qt-project.org] ? This needs fixing in Qt.

July 31, 2012

JMLA JMLA
Lab Rat
2 posts

This is nice, but on my MacBookPro with ML (and a brand new XCode) I still get an error like

11:09:29: Configuration unchanged, skipping qmake step.
11:09:29: Could not start process “make” -w
Error while building project ImportMML (target: Desktop)
When executing build step ‘Make’

What do you recommend ? Thanks ? jm

July 31, 2012

gosuperninja gosuperninja
Lab Rat
10 posts

JMLA, In the latest xcode the command line tools aren’t installed by default. Look in Xcode->preferences->downloads. Select “Command Line Tools”. Once you do this you may need to re-open QtCreator. But if this is the problem I would have expected Qt to complain earlier about not finding the tool chain.

July 31, 2012

JMLA JMLA
Lab Rat
2 posts

Thanks gosuperninja! It probably helps. Nevertheless the error code is now as below
(I turned back to one of the QT basic drawing examples, that has always been working!)
I am afraid I might be forced, to continue my work, to go for a while through Parallels… (:-(
(I have added on Qt Creator/Preferences…/Build & Run/Manual GCC with correct paths)

17:52:58: Running build steps for project basicdrawing…
17:52:58: Starting: “/usr/bin/make” clean -w
make: Entering directory `/Users/JML/QtSDK/Examples/4.7/painting/basicdrawing’
rm -f moc_renderarea.cpp moc_window.cpp
rm -f qrc_basicdrawing.cpp
rm -f main.o renderarea.o window.o moc_renderarea.o moc_window.o qrc_basicdrawing.o
rm -f *~ core *.core
make: Leaving directory `/Users/JML/QtSDK/Examples/4.7/painting/basicdrawing’
17:52:58: The process “/usr/bin/make” exited normally.
17:52:58: Running build steps for project ImportMML…
17:52:58: Starting: “/usr/bin/make” clean -w
make: Entering directory `/Users/JML/Desktop/Import_MML/ImportMML’
rm -f moc_mainwindow.cpp
rm -f ui_mainwindow.h
rm -f main.o mainwindow.o qtmmlwidget.o moc_mainwindow.o
rm -f *~ core *.core
make: Leaving directory `/Users/JML/Desktop/Import_MML/ImportMML’
17:52:58: The process “/usr/bin/make” exited normally.
17:52:58: Running build steps for project basicdrawing…
17:52:58: Configuration unchanged, skipping qmake step.
17:52:58: Starting: “/usr/bin/make” -w
make: Entering directory `/Users/JML/QtSDK/Examples/4.7/painting/basicdrawing’
g++-4.2 -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.7 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../Desktop/Qt/4.8.1/gcc/mkspecs/macx-g++42 -I. -I../../../../Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/Headers -I../../../../Desktop/Qt/4.8.1/gcc/include/QtCore -I../../../../Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/Headers -I../../../../Desktop/Qt/4.8.1/gcc/include/QtGui -I../../../../Desktop/Qt/4.8.1/gcc/include -I. -F/Users/JML/QtSDK/Desktop/Qt/4.8.1/gcc/lib -o main.o main.cpp
make: g++-4.2: No such file or directory
make: *** [main.o] Error 1
make: Leaving directory `/Users/JML/QtSDK/Examples/4.7/painting/basicdrawing’
17:52:58: The process “/usr/bin/make” exited with code 2.
Error while building project basicdrawing (target: Desktop)
When executing build step ‘Make’

July 31, 2012

gosuperninja gosuperninja
Lab Rat
10 posts

JMLA, That issue isn’t related to Mountain Lion. I had that one a bit ago. It has to do with QtCreator, there was a bug submitted about it. I’m using Qt Creator 4.5, it appears to be fixed. Maybe you’re using 4.4? In any case it’s a problem with the mkspec file that QtCreator picks, macx-g++42. It should be macx-g++. In the project settings override the spec and it should get past that issue. Hopefully thats your last problem :)

August 1, 2012

gosuperninja gosuperninja
Lab Rat
10 posts

FYI, I created a bug for the mmacosx-version-min=10.5 issue, https://bugreports.qt-project.org/browse/QTBUG-26734

August 2, 2012

elbunce elbunce
Lab Rat
1 posts

If you still want to compile and target 10.5 you need to install the 10.5 SDK. Alas it is not included with Xcode 4.4. It’s a bit hacky, but the following works…

Grab the xcode_3.2.6_and_ios_sdk_4.3.dmg from the developer.apple.com downloads area, and then:

  1. open xcode_3.2.6_and_ios_sdk_4.3.dmg
  2. cd /Volumes/Xcode\ and\ iOS\ SDK/Packages
  3. open MacOSX10.5.pkg

Make sure to select the appropriate install directory (i.e. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer). You can substitute ‘open MacOSX10.5.pkg’ for 10.5 support.

After installing the old SDK you’ll need to add some symlinks:

  1. cd "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/"
  2. ln -s i686-apple-darwin9 i686-apple-darwin11
  3. ln -s x86_64-apple-darwin9 x86_64-apple-darwin11

This worked for me. A similar hack can be used to get the 10.6 SDK, although you may want to grab that out of a later version of xCode… Best of luck!

Thanks and Enjoy,
Erik

Page  
2

  ‹‹ Qt 5 builds/installs on Windows platforms      [SOLVED] Mac/Win: Errors when building a simple project, right after installing a fresh copy of Qt SDK ››

You must log in to post a reply. Not a member yet? Register here!