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] subfolder .obj not generated when using CONFIG += object_parallel_to_source with nmake
QtWS25 Last Chance

[SOLVED] subfolder .obj not generated when using CONFIG += object_parallel_to_source with nmake

Scheduled Pinned Locked Moved General and Desktop
qmake5.5
3 Posts 2 Posters 2.8k Views
  • 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.
  • A Offline
    A Offline
    Ayuzawa
    wrote on last edited by Ayuzawa
    #1

    Hello,

    So my original problem is that I have one project where multiple files from different folders have the same name. I cannot change the names because those folders are part of a library that was previously compiled with visual studio that I am trying to transfer to Qt creator (with a qmake based compilation).
    I saw that when CONFIG += object_parallel_to_source is used the .obj are suposed to be placed in a replica of my project structure which solve the problem of the files with identical names.
    During the compilation i had linking error message telling me that some .obj files couldn't be found.

    So I tried it with a simpler project:
    project_folder:
    ->main.cpp
    ->subfolder:
    ->->func.h
    ->->func.cpp

    with the func.h & .cpp defining a simple "hello world" function that is called in the main

    The .pro file contains the following lines:

    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt
    SOURCES += main.cpp \
            subfolder\func.cpp
    HEADERS += subfolder\func.h
    CONFIG += object_parallel_to_source
    

    When executing Qmake it indeed create all the new folder for the compilation.
    But when compiling I get a linking error indicating that the file func.obj can't be found:
    LNK1104: cannot open file 'debug\subfolder\func.obj'

    And indeed the files doesn't exist. And when checking the copilation steps the func.cpp file is not compiled ...

    Is there anything I did wrong to use the object_parallel_to_source option?

    Ah and I precise, I'm not compiling with a shadow build (but I tryed it also and it doesn't works anyway)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Ayuzawa
      wrote on last edited by Ayuzawa
      #2

      Ok found the reason.
      The option CONFIG += object_parallel_to_source is currently bugged. Even if it create all the repertories to replicate the project folder it won't compile the .obj in them.

      Qmake produce compilation rules like this:

      {subfolder}.cpp{debug\}.obj::
      	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
      	$<
      <<
      

      but the one it should generate is

      {subfolder}.cpp{debug\subfolder}.obj::
      	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\subfolder @<<
      	$<
      <<
      

      EDIT: To get it to work you have to add CONFIG += no_batch even if there are no filename conflicts. Why it's not automaticaly done when you use the CONFIG += object_parallel_to_source will stay a mystery ...

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Good question, it might be a bug. You should check the bug report system for object_parallel_to_source to see if you find something about it.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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