Results 1 to 2 of 2

Thread: make for Mac

  1. #1
    Join Date
    Aug 2009
    Posts
    122
    Thanks
    74
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: make for Mac

    I'd like to know if the .pro file for mac should contain something Mac-specific in order to compile command line applications?

    I have a simple "Hello world" console application but I'm not seeing "Hello world" on the screen.

    This is how I compile:

    qmake -project
    qmake -spec macx-g++
    make

    My main.cpp
    Qt Code:
    1. #include <QCoreApplication>
    2. #include "gw.cpp"
    3. #include <iostream>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7.  
    8. QCoreApplication application(argc, argv);
    9.  
    10. gw();
    11.  
    12. return 0;
    13. }
    To copy to clipboard, switch view to plain text mode 

    My gw.cpp

    Qt Code:
    1. void gw()
    2. {
    3. cout << "Hello world";
    4. }
    To copy to clipboard, switch view to plain text mode 

    I have Mac OS X 10.6.8 and Xcode 3.2.6


    Added after 10 minutes:


    I found out that I didn't know how to run application properly. I had to do

    open test.app/Contents/MacOS/test

    This is a bit awkward. Is there a more elegant (shorter) way to start applications on command line?
    Last edited by timmu; 22nd January 2013 at 15:23.

  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: make for Mac

    I think this is not a correct forum to ask this question You should ask on some Mac forum.

    Uncle Google claims you should be able to do:
    open test.app
    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.


Similar Threads

  1. Replies: 6
    Last Post: 10th March 2011, 16:42
  2. Replies: 1
    Last Post: 5th March 2011, 18:23
  3. Replies: 1
    Last Post: 15th December 2010, 13:20
  4. qmake doesn't make a 'make' file
    By elyness in forum Installation and Deployment
    Replies: 1
    Last Post: 4th August 2010, 15:21
  5. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43

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.