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. App does not build
Forum Updated to NodeBB v4.3 + New Features

App does not build

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 729 Views 2 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.
  • B Offline
    B Offline
    Besajia
    wrote on last edited by Besajia
    #1

    Hello

    I have similar problem and still looking for a solution
    https://www.qtcentre.org/threads/6753-moc-with-same-file-names

    In the project there are many files with same name and in different directories

    controller.cpp
    

    there was the problem with object files put in plain directory which was successfully solved with

    CONFIG += object_parallel_to_source # recreate source folder tree for object files (replaces object_with_source). We need this because we have many same name files.
    

    but there is still one more problem that moc files are generated wrong way and I am getting errors

    Makefile:4830: warning: overriding recipe for target 'moc_controller.cpp'
    Makefile:4358: warning: ignoring old recipe for target 'moc_controller.cpp'
    

    and

    /home/.../controllers/controller.cpp:3: error: undefined reference to `vtable for Acquiring::Controller'
    

    where Controller is derived from QObject

    I know one of the solutions is to separate the project to several projects or rename files, but is there an option to make qmake generate moc files correctly?

    https://ubego.ru

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Besides of using pri files (sub projects ) for the duplicate names
      and use MOC_DIR for each i dont know any good way to solve it.

      Its not an option to simply rename the files ?

      B 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        Besides of using pri files (sub projects ) for the duplicate names
        and use MOC_DIR for each i dont know any good way to solve it.

        Its not an option to simply rename the files ?

        B Offline
        B Offline
        Besajia
        wrote on last edited by
        #3

        @mrjj MOC_DIR does not affect each .pri file, but whole project instead (

        https://ubego.ru

        mrjjM 1 Reply Last reply
        0
        • B Besajia

          @mrjj MOC_DIR does not affect each .pri file, but whole project instead (

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          so even you have one MOC_DIR for top level project and a MOC_DIR inside each .pri file
          the names still collide ?

          B 1 Reply Last reply
          0
          • mrjjM mrjj

            Hi
            so even you have one MOC_DIR for top level project and a MOC_DIR inside each .pri file
            the names still collide ?

            B Offline
            B Offline
            Besajia
            wrote on last edited by
            #5

            @mrjj yes, probably MOC_DIR works once per .pro file
            I still can not find solution. Instead of many controller.moc files the only one is generated and it stays in one folder.

            https://ubego.ru

            mrjjM 1 Reply Last reply
            0
            • B Besajia

              @mrjj yes, probably MOC_DIR works once per .pro file
              I still can not find solution. Instead of many controller.moc files the only one is generated and it stays in one folder.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @Besajia
              and each controller is included via its PRI file ?
              so the main project is the unique files and includes all controllers as PRI files only ?
              I have not personally tried this but it was my understanding it could work.
              But i guess not then.

              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