Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Can't compile project with makefile generated by qtmake
Forum Updated to NodeBB v4.3 + New Features

[Solved] Can't compile project with makefile generated by qtmake

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.1k 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.
  • F Offline
    F Offline
    fernandoaires
    wrote on last edited by
    #1

    Hi. I'm trying to compile my project through the command line using the makefile that was generated by qtmake, and when g++ tries to compile the source code it says "no such file or directory", but the sources and project file are in the same folder!

    Those are the steps I followed (all project and source files are in T:\QtTest):

    T:\QtTest> qmake -project
    T:\QtTest> qmake
    T:\QtTest> make

    And the output is:

    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory T:/QtTest' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.0\include\QtCore" -I"c:\Qt\4.8.0\include\QtGui" -I"c:\Qt\4.8.0\include" -I"." -I"c:\Qt\4.8.0\include\ActiveQt" -I"debug" -I"c:\Qt\4.8.0\mkspecs\default" -o debug\main.o main.cpp *g++: main.cpp: no such file or directory* g++: no input files mingw32-make[1]: *** [debug/main.o] Error 1 mingw32-make[1]: Leaving directory T:/QtTest'
    mingw32-make: *** [debug] Error 2

    Why can't g++ find my source file, if all project and source files are together in the same folder?
    Thanks!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Blizzard
      wrote on last edited by
      #2

      Have you installed the gcc-c++ package?

      sudo apt-get install g++

      Software Engineer | Aerospace & Defence

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Blizzard
        wrote on last edited by
        #3

        looks like this thread deals with the same error, hopefully it helps you solve your problem:

        http://www.qtforum.org/article/25985/compiling-hello-world-after-fresh-install-fails.html

        Software Engineer | Aerospace & Defence

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Blizzard
          wrote on last edited by
          #4

          The qmake doc. is also useful for linking problems:

          http://doc.qt.nokia.com/4.7-snapshot/qmake-project-files.html

          Software Engineer | Aerospace & Defence

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fernandoaires
            wrote on last edited by
            #5

            @Blizzard,

            Thanks, my problem was being caused by the same reason as described in http://www.qtforum.org/article/25985/compiling-hello-world-after-fresh-install-fails.html. In fact I had an Autorun entry in the Windows registry so that CMD.EXE would startup in a custom working directory.

            Removing that custom entry solved the problem.

            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