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.
  • K Offline
    K Offline
    kyleplattner
    wrote on last edited by
    #4

    Contents of my .pro file:

    @include(../src.inc)
    QMAKE_CXXFLAGS_DEBUG += -fprofile-arcs
    -ftest-coverage
    QT += declarative
    TARGET = harvest
    SOURCES += main.cpp
    harvest.cpp
    HEADERS += harvest.h
    CONFIG += no_fixpath
    RESOURCES = resources.qrc

    harvest.path = /usr/bin/harvest
    harvest.files = ../../build/dist/harvest
    INSTALLS += harvest@

    Here is the directory listing for the project folder:

    build build.inc harvest.pro harvest.pro.user src

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

      Usually the output line

      @make[1]: *** No rule to make target `main.cpp',...@

      is an indicator that you don't have a main.cpp file or it is not writeable or not in the directory.

      Maybe you could provide a little bit more information on your project?

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

        What sort of information would be helpful?

        Contents of ./harvest-app/src/

        @
        drwxr-xr-x 5 kp kp 4096 2011-01-18 09:20 .
        drwxr-xr-x 6 kp kp 4096 2011-01-18 09:20 ..
        -rw-r--r-- 1 kp kp 245 2011-01-18 07:53 harvest.cpp
        -rw-r--r-- 1 kp kp 296 2011-01-18 07:53 harvest.h
        drwxr-xr-x 3 kp kp 4096 2011-01-18 07:53 images
        -rw-r--r-- 1 kp kp 518 2011-01-18 08:04 main.cpp
        -rw-r--r-- 1 kp kp 316 2011-01-18 09:28 main.pro
        -rw-r--r-- 1 kp kp 12179 2011-01-18 09:31 main.pro.user
        drwxr-xr-x 3 kp kp 4096 2011-01-18 07:53 qml
        -rw-r--r-- 1 kp kp 5467 2011-01-18 07:53 resources.qrc
        drwxr-xr-x 6 kp kp 4096 2011-01-18 07:53 .svn
        @

        [EDIT: code formatting, for listing, Volker]

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

          As I keep looking it seems to have something to do with a main.o file which doesn't exist in my folder structure. Where can I get this?

          1 Reply Last reply
          0
          • 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