Unsolved error from /bin/sh when compiling under Linux
-
Did a fresh install of Qt5.6 on a Linux box and opened a project with the source that builds fine on the same machine under Netbeans. But it does not build under QtCreator:
10:04:39: Running steps for project MandelbrotQt... 10:04:39: Configuration unchanged, skipping qmake step. 10:04:39: Starting: "/usr/bin/make" g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -IC:/Program\ Files\ (x86)/AMD\ APP\ SDK/3.0/include -I../../Qt/5.6/gcc_64/include -I../../Qt/5.6/gcc_64/include/QtWidgets -I../../Qt/5.6/gcc_64/include/QtGui -I../../Qt/5.6/gcc_64/include/QtConcurrent -I../../Qt/5.6/gcc_64/include/QtNetwork -I../../Qt/5.6/gcc_64/include/QtCore -I. -I. -I../../Qt/5.6/gcc_64/mkspecs/linux-g++ -o main.o main.cpp /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -IC:/Program\ Files\ (x86)/AMD\ APP\ SDK/3.0/include -I../../Qt/5.6/gcc_64/include -I../../Qt/5.6/gcc_64/include/QtWidgets -I../../Qt/5.6/gcc_64/include/QtGui -I../../Qt/5.6/gcc_64/include/QtConcurrent -I../../Qt/5.6/gcc_64/include/QtNetwork -I../../Qt/5.6/gcc_64/include/QtCore -I. -I. -I../../Qt/5.6/gcc_64/mkspecs/linux-g++ -o main.o main.cpp' make: *** [main.o] Error 1 10:04:39: The process "/usr/bin/make" exited with code 2. Error while building/deploying project MandelbrotQt (kit: Desktop Qt 5.6.0 GCC 64bit) When executing step "Make" 10:04:39: Elapsed time: 00:00.
-
Hi @nulluse,
The project that you are compiling seems to include Windows paths(?) which the compiler is unable to parse properly. Check the .Pro file. -
Yes, I have the OpenCL include and libs paths from the Windows machine.
How can I make them multiplatform in the .pro file? -
@nulluse It is probably included in your project's (MandelbrotQt ?) .pro file.
-
Sorry, I do not follow.
-
For now I converted the paths to the Linux format, but still need to make this multiplatform in the .pro file.
The project still does not build: http://pastebin.com/raw/KmT1NnhN
Tons of errors outside of the project source code. This builds just fine under MingW. Is it incompatible with GCC 4.8.3?$ gcc --version gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
@nulluse I'll try to explain.
When you compile your projectMandelbrotQt
the compiler tries to compilemain.cpp
against some set of libraries some dependent paths for header files. The following line shows it:
g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -IC:/Program\ Files\ (x86)/AMD\ APP\ SDK/3.0/include -I../../Qt/5.6/gcc_64/include -I../../Qt/5.6/gcc_64/include/QtWidgets -I../../Qt/5.6/gcc_64/include/QtGui -I../../Qt/5.6/gcc_64/include/QtConcurrent -I../../Qt/5.6/gcc_64/include/QtNetwork -I../../Qt/5.6/gcc_64/include/QtCore -I. -I. -I../../Qt/5.6/gcc_64/mkspecs/linux-g++ -o main.o main.cpp
Notice the path
C:/Program\ Files\ (x86)/AMD\ APP\ SDK/3.0/include
.
First this Windows OS specific path shouldn't be there when you compile the project on Unix based system.
So now that it is included accidentally when the compiler encounters this path, it is unable to parse it due to space or special characters in the path.
In case of Qt this user defined path is actually added from projects .pro file.
So you have to modify the pro file so that the platform dependent paths are picked up accordingly or just remove these Windows OS based paths for quick test. -
-
I don't know GCC version as I do not have access to the Windows machine this came from. All I know they have installed the current as of today version of Qt5 with MingW 4.9.2 toolchain.
-
@nulluse Unfortunately I too don't know what is leading to those errors. What is at line 3 of main.cpp ?