0
votes

I am trying to run a simple console application (Hello World program) on Qt 5.6.0. Here is the code:

#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
 QCoreApplication a(argc, argv);

 qDebug() << "Hello World";
 return a.exec();
}

But it's generating error. ([main.o]error 2).

11:37:44: Running steps for project test... 11:37:44: Configuration unchanged, skipping qmake step. 11:37:44: Starting: "/usr/bin/make" /Applications/Xcode 7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -isysroot /Applications/Xcode 7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mFile Doesn't Exist, Will Create: /Applications/Xcode Invalid Arguments -version-min=10.7 -Wall -W -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../test -I. -I../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers -I../Qt5.6.0/5.6/clang_64/lib/QtGui.framework/Headers -I../Qt5.6.0/5.6/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode -I7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode -I7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers/ -I. -I../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang -F/Users/macwaves/Qt5.6.0/5.6/clang_64/lib -o main.o ../test/main.cpp /bin/sh: -c: line 0: unexpected EOF while looking for matching `'' /bin/sh: -c: line 1: syntax error: unexpected end of file make: *** [main.o] Error 2 11:37:44: The process "/usr/bin/make" exited with code 2. Error while building/deploying project test (kit: Desktop Qt 5.6.0 clang 64bit) When executing step "Make" 11:37:44: Elapsed time: 00:00.

I tried to set PATH (/Users/macwaves/Qt5.6.0/5.6/clang_64/bin). Renamed my Xcode 7.app to Xcode7.app but, problem still persists.

Can anybody help?

Here is a snapshot of my problem :

enter image description here

1
You’re compile the program, you’re not running it. The error is in the compilation step, and apparently in the build system rather than your actual code. - Frank Osterfeld
It looks like indeed like the space in the XCode path is your problem. If you renamed it, the change wasn’t picked up: "Applications/Xcode -I7.app”. I’d go for "/Application/XCode” which is the standard installation path. (does the app store handle updates correctly at all, with the changed path?) - Frank Osterfeld
Thanks for the comment. Can you please give me instructions step by step? @FrankOsterfeld - Punit Tripathi
Rename the Xcode folder to /Applications/Xcode (the default). Delete your build dir and rebuild. - Frank Osterfeld
I have just uninstall(5.6.0) and reinstalled the older version (5.5.1) on my mac os x. It works smoothly. :) - Punit Tripathi

1 Answers

0
votes

I have just uninstall(5.6.0) and reinstalled the older version (5.5.1) on my mac os x. It works smoothly. :)