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. qmake source
Forum Updated to NodeBB v4.3 + New Features

qmake source

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k 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.
  • D Offline
    D Offline
    danyal
    wrote on last edited by
    #1

    when I try to build a project, I get a warning
    :-1: warning: C:/RealsenseRecorder/source/main.cpp conflicts with C:/gtestExample/main.cpp
    but when i print SOURCES variable i get

    C:/googletest/googletest/src/gtest-all.cc C:/googletest/googlemock/src/gmock-all.cc C:/gtestExample/main.cpp C:\RealsenseRecorder\source\audiorecorder.cpp C:\RealsenseRecorder\source\mainwindow.cpp C:\RealsenseRecorder\source\videorecorder.cpp

    as you can see, there is no
    C:/RealsenseRecorder/source/main.cpp

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

      Hi
      Check the pro file if its listed.
      Also check its not using SOURCE += *.cpp or something like that.
      Also delete the actual build folder.
      Then rebuild all.

      Oh just saw.
      Did you use
      SOURCES += $$PWD$$/source/*.cpp
      for this project ?

      Also , does the file actually exists where it says?

      1 Reply Last reply
      2
      • D Offline
        D Offline
        danyal
        wrote on last edited by
        #3

        no, in this project I did not write like that to exclude the main.cpp. Yes, such a file does exist

        HEADERS += tst_1.h
        HEADERS += C:\RealsenseRecorder\include\mainwindow.h
        HEADERS += C:\RealsenseRecorder\ui_mainwindow.h
        SOURCES += $$PWD$$/main.cpp

        INCLUDEPATH += C:\RealsenseRecorder
        INCLUDEPATH += C:\RealsenseRecorder\include
        INCLUDEPATH += "$(RSSDK_DIR)/include"
        INCLUDEPATH += "$(OPENCV3_DIR)/include"

        SOURCES += C:\RealsenseRecorder\source\audiorecorder.cpp
        SOURCES += C:\RealsenseRecorder\source\mainwindow.cpp
        SOURCES += C:\RealsenseRecorder\source\videorecorder.cpp

        SOURCES -= C:\RealsenseRecorder\source\main.cpp
        message($$SOURCES)

        pwd is equal C:\gtestExample

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

          Hi
          If its not listed in .pro and you do not
          auto add with *.cpp
          It seems pretty impossible.

          1 Reply Last reply
          0
          • Paul ColbyP Offline
            Paul ColbyP Offline
            Paul Colby
            wrote on last edited by Paul Colby
            #5

            Hi @danyal,

            First, I'd print SOURCES in lots of places, but especially before and after your $$PWD line (and note that the second $$ does nothing) eg:

            messages(A: $$SOURCES)
            SOURCES += $$PWD/main.cpp
            messages(B: $$SOURCES)
            

            Next try running: qmake -r -Wall -Wlogic -Wparser and show us the output.

            Then, if there's nothing obvious there, add up to three -d arguments as well.

            With -d things can get pretty noisy, so personally, I'd do something like:

            qmake -d -d -d -d -r -Wall -Wlogic -Wparser 2>&1 | grep 'RealsenseRecorder.*main\.cpp'
            

            to try to narrow down the problem quicker (not sure of the equivalent syntax on Windows, or if that syntax is valid on Windows). Typically I'd follow that up by replacing the grep with less and search through to each instance of main.cpp, but you might prefer to output to a file and look through it with a text editor or something. Whatever works for you.

            Another thing to check is: do you have any include statements anywhere in your project's QMake files? (this would probably be revealed by the qmake -r output above too).

            Cheers.

            1 Reply Last reply
            3

            • Login

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