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. [Merged, Moved] Compile problems on Ubuntu and OS X
Forum Updated to NodeBB v4.3 + New Features

[Merged, Moved] Compile problems on Ubuntu and OS X

Scheduled Pinned Locked Moved Qt Creator and other tools
18 Posts 5 Posters 10.2k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lycis
    wrote on last edited by
    #8

    Well as browsing through the forum I suppose this is the same topic as "here?":http://developer.qt.nokia.com/forums/viewthread/3279/

    I assume it's better to talk about this topic there because missing declarations in the .pro file would have been my next guess and it looks like this is not a platform dependant issue!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #9

      The paths to your main.cpp and harvest.cpp and other SOURCES and HEADERS are wrong. They must be either

      • absolute path (not recommended)
      • or relative to the directory where your .pro file is in

      To achieve the latter, go to a shell, enter the directory where your .pro file lives and list the source file on the command line like this:

      @
      ls -l src/main.cpp
      @

      If you see a result, the argument to ls is what must go into your .pro file.

      Also, qmake should have printed a warning on the console:

      @
      $ qmake
      WARNING: Failure to find: main.cpp
      WARNING: Failure to find: harvest.cpp
      WARNING: Failure to find: harvest.h
      @

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lycis
        wrote on last edited by
        #10

        The .o files are generated by your compiler.

        Are your source files stored in the same directory as your .pro-file? If not, this might be kind of problem, because your project file declares it's sources to be

        @SOURCES += main.cpp
        harvest.cpp@

        This usually means that these files are in the same folder as the .pro-file.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kyleplattner
          wrote on last edited by
          #11

          I am using both OS X and Ubuntu and having issues on each. I tried both areas since with a different os in each because I wasn't for sure where the best location was for it.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kyleplattner
            wrote on last edited by
            #12

            They are not. I will do some experimenting.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #13

              I've merge the two threads since they are about the same problem and moved to the Tools forum, because it's more a qmake question.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kyleplattner
                wrote on last edited by
                #14

                Thats fine. Still having some issues... and still poking around.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lycis
                  wrote on last edited by
                  #15

                  An easy solution for the SOURECS definition is to declare it as:
                  (notice that I assume that your sources and headers are located in src)

                  @
                  SOURCES += src/main.cpp
                  src/harvest.cpp
                  INCLUDEPATH += src/
                  @

                  With INCLUDEPATH qmake will configure make to find all header files within the src folder because this will also cause some trouble if they are not found.

                  I hope this helps you a little bit.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Scylla
                    wrote on last edited by
                    #16

                    On my Mac the mkspec is per default macx-xcode. To compile the project in a console use qmake -spec macx-g++ && make. This works for me.

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kyleplattner
                      wrote on last edited by
                      #17

                      That change rendered this error:

                      @Running build steps for project main...
                      Configuration unchanged, skipping qmake step.
                      Starting: "/usr/bin/make" -w
                      make: Entering directory /home/kp/Desktop/harvest-app/src/main-build-desktop' /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ QMLJSDEBUGGER_PATH=/home/kp/qtcreator-2.1.81/share/qtcreator/qml/qmljsdebugger /home/kp/Desktop/harvest-app/src/main/main.pro make: Leaving directory /home/kp/Desktop/harvest-app/src/main-build-desktop'
                      /home/kp/Desktop/harvest-app/src/main/main.pro:13: Parse Error ('src/harvest.cpp')
                      Error processing project file: /home/kp/Desktop/harvest-app/src/main/main.pro
                      make: *** [/home/kp/Desktop/harvest-app/src/main-build-desktop/Makefile] Error 3
                      The process "/usr/bin/make" exited with code 2.
                      Error while building project main (target: Desktop)
                      When executing build step 'Make'@

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kyleplattner
                        wrote on last edited by
                        #18

                        My problem had to do with a shadow build and installing unit test files.

                        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