Results 1 to 3 of 3

Thread: Compile and Run Qt programs in ubuntu 12.04

  1. #1
    Join Date
    May 2012
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Compile and Run Qt programs in ubuntu 12.04

    How can I compile and run Qt programs in ubuntu 12.04??I tried using
    Qt Code:
    1. g++ sample.cpp -o sample
    2. sample.cpp:1:22: fatal error: qt4/QtGui: No such file or directory
    To copy to clipboard, switch view to plain text mode 
    but it gives an error

    and I double check the installation files of Qt and everything is there

    Any comments???

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Compile and Run Qt programs in ubuntu 12.04

    First see the documentation page, you need to run qmake -project first to generate project, then run qmake to generate makefile and then run make to build.

    Anyway your current problem might be some issue with the path to Qt headers, but first try as described in the getting started page.

  3. #3
    Join Date
    Mar 2012
    Location
    Chennai/India
    Posts
    8
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Compile and Run Qt programs in ubuntu 12.04

    Hi,
    I am using qt-sdk(4.7) in ubuntu 12.04,when i open some programs in qtcreator my header files are marked with green lines and showing "QtGui no such file or directory" but i can compiile and run the program without error,please tell me how to rectify it.

Similar Threads

  1. Replies: 0
    Last Post: 21st September 2011, 15:38
  2. Can't Compile on Ubuntu Linux
    By mpauley in forum Newbie
    Replies: 6
    Last Post: 9th April 2010, 22:00
  3. Programs compile in debug mode - solved
    By tpf80 in forum Installation and Deployment
    Replies: 1
    Last Post: 18th August 2008, 09:53
  4. [WIN XP]installed corectly (?) but cant compile tutorial programs
    By ppn in forum Installation and Deployment
    Replies: 2
    Last Post: 9th September 2007, 08:02
  5. Can't compile programs in Visual Studio.net 2005
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 7th July 2006, 14:10

Tags for this Thread

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.