PDA

View Full Version : error while making program from command line



saman_artorious
4th July 2013, 08:45
The QtCreator run the program normally. However, in order to test memory, I need to run it from command line. When I make it,


make -lGLEW -lGL

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Iudp -Ithread_safe -I. -I. -o camera.o camera.cpp
In file included from camera.cpp:1:0:
camera.h:4:21: fatal error: QGLWidget: No such file or directory
compilation terminated.


As I checked the .pro file, what it includes is exactly the same thing that QtCreator has when it runs the program successfully.

.pro file:


greaterThan(QT_MAJOR_VERSION, 4): QT += widgets opengl

TARGET = SonarDisplay
TEMPLATE = app

LIBS += -lGLEW -lGL
...


Am I missing something?

wysota
4th July 2013, 08:49
Did you remember to run the appropriate qmake instance? It seems you ran the one from Qt4, was that your intention?

saman_artorious
4th July 2013, 09:22
I am using qtcreator 5.x.x. But, I think the qmake is from qt4. how can I fix it?

wysota
4th July 2013, 10:30
You can execute qmake from Qt5 :)

saman_artorious
4th July 2013, 10:47
You can execute qmake from Qt5 :)

I am very sorry, but, I don't know how to do that. (considering that my OS is Linux)

wysota
4th July 2013, 10:53
/path/to/your/Qt5/bindir/qmake

saman_artorious
4th July 2013, 11:32
/path/to/your/Qt5/bindir/qmake

There's a directory inside qtbase, it is qmake:

/opt/Qt5.0.1/5.0.1/Src/qtbase/qmake


UPDATE:
the installation guide does it this way:

/usr/local/Qt-5.0.1/bin/qmake qwt.pro

But, for me, Qt-5.xx is not inside /usr/local .... nor can I find where it exists.

wysota
4th July 2013, 12:56
Where did you install Qt5 after you downloaded it?

saman_artorious
4th July 2013, 16:36
Where did you install Qt5 after you downloaded it?

inside /opt directory. it's default location under Linux.

wysota
4th July 2013, 16:57
So go there and look for a bin directory containing a qmake binary.

starling13
12th November 2013, 13:10
Sorry if the question is offtopic.

I'm trying to build Qt 4.8.5 for crosscompilation of non-gui embedded applications on the Xilinx PowerPC 405 platform,
using eldk-5.3 (powerpc-4xx-softfloat)
I have modified the qws/linux-powerpc-g++, setting correct paths to crosstoolchain tools.
After that I was able to successfuly build libraries (QtCore, QtSql, QtXml, QtNetwork, QtTest).
Qmake was also built.
Tools, headers and libraries was installed in the toolchain directories.

The problem is with qmake.
In the directory with the smallest main.cpp test for QCoreApplication running:

$ /opt/eldk-5.3/powerpc-4xx-softfloat/sysroots/i686-eldk-linux/usr/bin/qmake -project

gives the project file:

################################################## ####################
# Automatically generated by qmake (2.01a) ?? ??? 12 20:48:51 2013
################################################## ####################

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += main.cpp

Then, running:

$ /opt/eldk-5.3/powerpc-4xx-softfloat/sysroots/i686-eldk-linux/usr/bin/qmake -spec qws/linux-powerpc-g++ VPATH=.

produces given Makefile

As can be seen, DEFINES and CXXFLAGS was untouched (no optimisation and linkage parameters was set), thus compilation and linking lacks most arguments.

Any kind of help will be appreciated, thanks.

starling13
13th November 2013, 07:15
[SOLVED]
It was necessary to copy mkspecs/features/* to crosstoolchain mkspecs