Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to compile on Mac OS X

How to compile on Mac OS X

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 7.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    scrolling
    wrote on last edited by
    #1

    Hi everyone!

    I'm new in Qt, and I got a tutorial where it says that to compile, having a .cpp file, I just need to do this:

    qmake -project
    qmake file.pro
    make

    That works in Windows but in Mac OS X (10.7) it creates a xcode project file by default, and an info.plist file, so, "make" doesn't work.

    I'm new and I don't wanna use QtCreator because it creates a lot of files that I don't need (yet...). So, my question is: Is there an easy way to compile my .cpp files from console on Mac OS X?

    Thanks!

    BTW. I read the qmake tutorial in the QtCreator help and tried with:

    qmake -makefile -o Makefile file.pro

    but still creates the xcode project... :/

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Serenity
      wrote on last edited by
      #2

      What do you mean with "It creates a xcode project file by default"?

      Can you please post the output of this commands, you use:

      qmake -project
      qmake file.pro
      make

      Please also post the Makefile after doing qmake file.pro.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to DevNet,

        Try again passing the macx-g++ mkspec, by default the mkspec is for xcode

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          scrolling
          wrote on last edited by
          #4

          Hi again! and thank you for your help!

          When I do "qmake -project" there is no output in the console, just it creates the "pro" file (file.pro). Then I do "qmake file.pro", and there is no output again, but two files are created: "info.plist" and "file.xcodeproj". If I try to run "make", the output is:

          make: *** No targets specified and no makefile found. Stop.

          The .xcodeproj file can't be opened with xcode, if I try that xcode says:

          Project file.xcodeproj cannot be opened: didn't find classname for 'isa' key

          So, I can't compile my program.

          SGaist, I can't run macx-g++ (it says "command no found") :/ how can I excecute it?

          Thank you again and sorry for my english, I speak spanish.

          Regards!

          Edit:

          I found this page: https://bugreports.qt-project.org/browse/QTBUG-29371 and did the replacement, and then i got this message:

          Project file.xcodeproj cannot be opened because the project file cannot be parsed.

          :/ Thanks again!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Serenity
            wrote on last edited by
            #5

            okay, maybe one more point for my list "Why I hate MacOS"...

            I know, that you wrote it, but using QtCreator would be solve your problem.
            If you are new in Qt, I prefer to give it a try. You can easily take a look in the reference manual by pressing F1 in the code, so you can find fast your functions for your needs.

            Take also a look to the Shortcuts: http://qt-project.org/wiki/Qt_Creator_Keyboard_Shortcuts
            I also used Eclipse a long time before and I also use it for non-Qt projects. Qt projects are easier to handle (exept for version control).

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              IIRC you have to install the "command line tools" for XCode then you should be good

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved