Results 1 to 7 of 7

Thread: how to compile c++ source file in qtCreator

  1. #1
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to compile c++ source file in qtCreator

    hi there......i installed the qtcreator in windows and i just want to know if it is possible to compile c++ source file......
    for example if i create a c++ source file (from the New tab) and write a small program suppose hello world.....so how can i compile it.....
    i am now learning c++ a bit so i want to compile my file can i do it using this IDE or what i have to do to compile c++ source file in this IDE........

    P.S: my program is not GUI based i am talking about C++ programming the general one.......

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

    Default Re: how to compile c++ source file in qtCreator

    You have to hit the big green arrow button on the left panel of Creator. It will call qmake and make/nmake behind the scenes so you need that configured as well.
    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
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to compile c++ source file in qtCreator

    I bet he will face another problem. I will assume that orky7 created just a new C++ file, so there is no pro file.

    If this is true then just go into the directory containing your source file and run qmake -project. Then do what wysota has written.
    I'm a rebel in the S.D.G.

  4. #4
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to compile c++ source file in qtCreator

    u r right with the first line @lyuts.......so u mean i go to C:\Qt\2009.01\bin\neww (neww is the folder containing my hello.cpp file) and open the windows command prompt and type in "qmake -project" and after that return back and hit the green button on the ide.......

  5. #5
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to compile c++ source file in qtCreator

    hi i just created a console application and edited the .cpp file and its running but there is no .exe file get created(one is created under debug folder which if i open says a dll file is missing) so where to find the exe of my console app..........

    or cant i somehow link the gcc provided by the qtcreator ide into the ide and compile and run my file and form .exe file for the .cpp source file........
    Last edited by orky7; 18th March 2009 at 22:44.

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

    Default Re: how to compile c++ source file in qtCreator

    You need to make sure the dynamic linker can find appropriate dll files when starting your application. You can copy appropriate dll files to the debug folder or to your system folder.
    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. The following user says thank you to wysota for this useful post:

    orky7 (20th March 2009)

  8. #7
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to compile c++ source file in qtCreator

    every thing just sorted out thanks...............

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  3. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  4. Compile of big generated file in release stuck
    By Equilibrium in forum Qt Programming
    Replies: 4
    Last Post: 31st December 2007, 12:25
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.