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. $$PWD is not correct in a network-map driver
Qt 6.11 is out! See what's new in the release blog

$$PWD is not correct in a network-map driver

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 368 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.
  • Q Offline
    Q Offline
    QtTester
    wrote on last edited by QtTester
    #1

    Hi ,guys:
    here is my file structure in Windows10:

    MyProjectRootDirectory
    --MainExe
    ----MainExe.pro
    ----Project.pri
    --Config.pri
    --LibConfig.pri
    

    in Config.pri ,it will include Project.pri like this:

    include($$PWD/MainExe/Project.pri)
    

    it works in my local computer, named A.
    when I works on another computer,named B, and map the project root directory to B's Driver as Z: , and recompile the MainExe.pro, it shows error:

    Cannot read Z:/MainExe/MainExe/Project.pri: No such file or directory
    

    use message($$PWD) it says:

    Z:\MainExe
    

    but it should be:

    Z:\
    

    when copy the project files to computer B's local driver ,like D:\, it works fine again.

    So, why $$PWD is not correct shown in a network-map driver???

    if we change it to a relative directory, some include path may not work neither, we prefer absolute path.

    JonBJ 1 Reply Last reply
    0
    • Q QtTester

      Hi ,guys:
      here is my file structure in Windows10:

      MyProjectRootDirectory
      --MainExe
      ----MainExe.pro
      ----Project.pri
      --Config.pri
      --LibConfig.pri
      

      in Config.pri ,it will include Project.pri like this:

      include($$PWD/MainExe/Project.pri)
      

      it works in my local computer, named A.
      when I works on another computer,named B, and map the project root directory to B's Driver as Z: , and recompile the MainExe.pro, it shows error:

      Cannot read Z:/MainExe/MainExe/Project.pri: No such file or directory
      

      use message($$PWD) it says:

      Z:\MainExe
      

      but it should be:

      Z:\
      

      when copy the project files to computer B's local driver ,like D:\, it works fine again.

      So, why $$PWD is not correct shown in a network-map driver???

      if we change it to a relative directory, some include path may not work neither, we prefer absolute path.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @QtTester said in $PWD is not correct in a network-map driver:

      and map the project root directory to B's Driver as Z:

      One possibility: under Windows each drive maintains its own current directory on that drive. I don't know whether this is used by the build process. Assuming you can build from a Command Prompt, prior to doing so if you go

      Z:
      cd \
      rem Or:
      cd /d Z:\
      

      and then build does this make any difference?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mchinand
        wrote on last edited by
        #3

        I wonder if _PRO_FILE_PWD_ would work any better for you.

        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