Results 1 to 12 of 12

Thread: error while making program from command line

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default error while making program from command line

    The QtCreator run the program normally. However, in order to test memory, I need to run it from command line. When I make it,
    Qt Code:
    1. make -lGLEW -lGL
    2.  
    3. 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
    4. In file included from camera.cpp:1:0:
    5. camera.h:4:21: fatal error: QGLWidget: No such file or directory
    6. compilation terminated.
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets opengl
    2.  
    3. TARGET = SonarDisplay
    4. TEMPLATE = app
    5.  
    6. LIBS += -lGLEW -lGL
    7. ...
    To copy to clipboard, switch view to plain text mode 

    Am I missing something?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error while making program from command line

    Did you remember to run the appropriate qmake instance? It seems you ran the one from Qt4, was that your intention?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    I am using qtcreator 5.x.x. But, I think the qmake is from qt4. how can I fix it?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error while making program from command line

    You can execute qmake from Qt5
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    Quote Originally Posted by wysota View Post
    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)

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error while making program from command line

    /path/to/your/Qt5/bindir/qmake
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    Quote Originally Posted by wysota View Post
    /path/to/your/Qt5/bindir/qmake
    There's a directory inside qtbase, it is qmake:
    Qt Code:
    1. /opt/Qt5.0.1/5.0.1/Src/qtbase/qmake
    To copy to clipboard, switch view to plain text mode 


    UPDATE:
    the installation guide does it this way:
    Qt Code:
    1. /usr/local/Qt-5.0.1/bin/qmake qwt.pro
    To copy to clipboard, switch view to plain text mode 

    But, for me, Qt-5.xx is not inside /usr/local .... nor can I find where it exists.
    Last edited by saman_artorious; 4th July 2013 at 11:47.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error while making program from command line

    Where did you install Qt5 after you downloaded it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    Quote Originally Posted by wysota View Post
    Where did you install Qt5 after you downloaded it?
    inside /opt directory. it's default location under Linux.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error while making program from command line

    So go there and look for a bin directory containing a qmake binary.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Nov 2013
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    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.
    Attached Files Attached Files

  12. #12
    Join Date
    Nov 2013
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error while making program from command line

    [SOLVED]
    It was necessary to copy mkspecs/features/* to crosstoolchain mkspecs

Similar Threads

  1. Replies: 7
    Last Post: 27th March 2013, 03:40
  2. Replies: 1
    Last Post: 2nd July 2011, 22:46
  3. Qt4 'breaks' command line program
    By kachofool in forum Newbie
    Replies: 7
    Last Post: 13th November 2009, 20:56
  4. QProcess and the command line
    By auba in forum Qt Programming
    Replies: 17
    Last Post: 27th May 2009, 10:39
  5. Is there a command-line window in Qt4?
    By miaoliang in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2006, 08:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.