After moving project folder into a different path, QT keeps looking for files to include into the old path.
-
I'm trying to compile this repository: https://github.com/OpenGP/starlab
I had initially cloned it into C:/users/marin/Documents/UNIPI/TESI/Workspace/starlab/
then moved it to C:/builds/starlabThen when I run qmake on the .pro file it gives me error messages saying it can't find files in the old path:
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/starlab.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/surfacemesh/surfacemesh/surfacemesh.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/external/nanoflann-1.1.9/nanoflann.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/external/cholmod-4.0.0/cholmod.prf: No such file or directoryIt should be looking for those files into the repo's subdirectories in the new path, but it keeps looking for them in the old one.
-
I'm trying to compile this repository: https://github.com/OpenGP/starlab
I had initially cloned it into C:/users/marin/Documents/UNIPI/TESI/Workspace/starlab/
then moved it to C:/builds/starlabThen when I run qmake on the .pro file it gives me error messages saying it can't find files in the old path:
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/starlab.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/surfacemesh/surfacemesh/surfacemesh.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/external/nanoflann-1.1.9/nanoflann.prf: No such file or directory
:-1: error: Cannot read C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/external/cholmod-4.0.0/cholmod.prf: No such file or directoryIt should be looking for those files into the repo's subdirectories in the new path, but it keeps looking for them in the old one.
-
Hi,
Check if you have any hidden files starting with a . in your sources and build folders.
-
Hi,
Check if you have any hidden files starting with a . in your sources and build folders.
@SGaist there's a .qmake.stash file in the build folder but I doubt that's the problem, as its contents are:
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1916
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627045
QMAKE_CXX.COMPILER_MACROS =
QT_COMPILER_STDCXX
QMAKE_MSC_VER
QMAKE_MSC_FULL_VER
QMAKE_CXX.INCDIRS =
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include"
"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt"
QMAKE_CXX.LIBDIRS =
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x64"
"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64"
"C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64"
"C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" -
@SGaist there's a .qmake.stash file in the build folder but I doubt that's the problem, as its contents are:
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1916
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627045
QMAKE_CXX.COMPILER_MACROS =
QT_COMPILER_STDCXX
QMAKE_MSC_VER
QMAKE_MSC_FULL_VER
QMAKE_CXX.INCDIRS =
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include"
"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt"
"C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt"
QMAKE_CXX.LIBDIRS =
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x64"
"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64"
"C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64"
"C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" -
@mvreenv
At this point I would try to find where that"old" string might be being picked up from. What about something like:cd C:/builds/starlab findstr /s/i UNIPI *.*
?
@JonB I tried this and it doesn't find any matches. I tried running qmake on another repository (https://github.com/taiya/starlab-mcfskel) that adds to starlab and it gives the same error, at this point I think the problem probably lies inside qmake
-
It looks like the .pro project files reference the .prf files relative to PWD variable which seems fine (see example below). All the references to .prf files don't use 'qmake -set ...' but for those that do, you can check what those variables get set to.
-
It looks like the .pro project files reference the .prf files relative to PWD variable which seems fine (see example below). All the references to .prf files don't use 'qmake -set ...' but for those that do, you can check what those variables get set to.
@mchinand I tried doing this
message($$PWD) system(qmake -set STARLAB $$PWD/starlab.prf) message($$[STARLAB])
and I get this
Project MESSAGE: C:/builds/starlab/core Project MESSAGE: C:/Users/marin/Documents/UNIPI/TESI/Workspace/starlab/core/starlab.prf
The PWD value goes back to the old path when there's "qmake -set"
-
I've never used the
-set
option of qmake but looks like it makes the settings persist between calls. It seems like it should update the variables when you call it again. Run the following and see if your (old) paths are there.qmake -query
I don't see a way to unset variables (I would have thought setting it again would overwrite it). The documentation says these values are stored in a QSettings but I'm not sure where exactly (probably somewhere in your AppData folder somewhere) What version of Qt are you using? Perhaps upgrade to a newer version. You may want to replace those
qmake -set
lines with just plain variable assignments but you may have it in additional files. Maybe moving all theqmake -set
calls to your top-level .pro file will help. -
I've never used the
-set
option of qmake but looks like it makes the settings persist between calls. It seems like it should update the variables when you call it again. Run the following and see if your (old) paths are there.qmake -query
I don't see a way to unset variables (I would have thought setting it again would overwrite it). The documentation says these values are stored in a QSettings but I'm not sure where exactly (probably somewhere in your AppData folder somewhere) What version of Qt are you using? Perhaps upgrade to a newer version. You may want to replace those
qmake -set
lines with just plain variable assignments but you may have it in additional files. Maybe moving all theqmake -set
calls to your top-level .pro file will help.@mchinand the
-set
option was used in the repository I cloned.I tried running
system(qmake -query)
but it doesn't show anything in the output.I looked into the <user>\AppData\Roaming\QtProject\ and there's a QtCreator.ini file but it only stores information for the configuration of Qt Creator.
So I tried adding this after all the
system(qmake -set)
calls:for(var, $$list($$enumerate_vars())) { message($$var) message($$eval($$var)) }
and got the value of
QMAKESPEC
which is "A system variable that contains the full path of the qmake configuration that is used when generating Makefiles. The value of this variable is automatically computed." (https://doc.qt.io/qt-5/qmake-variable-reference.html#qmakespec). I then followed the path and opened theqmake.conf
file found there but it doesn't store any of the set values with thesystem(qmake -set)
calls.With the listing of all the variables and their value I got this:
PWD = C:/builds/starlab/core OUT_PWD = C:/builds/starlab/core _PRO_FILE_PWD_ = C:/builds/starlab/core
And when I try to search for "STARLAB" or "EIGENPATH" (which should've been set to something) in the output there are no results. I also tried searching for the old path but still no results.
I am using Qt 5.12.12, which I also uninstalled and reinstalled to try and solve this problem, with no success.
-
Since it's Windows, take a look at the registry.
-
You can do it outside of your project file. Here's a test I did:
C:\Qt\5.14.2\msvc2017_64\bin> .\qmake -set ASDFTESTVARIABLE XYZ C:\Qt\5.14.2\msvc2017_64\bin> .\qmake -query ASDFTESTVARIABLE:XYZ QT_SYSROOT: QT_INSTALL_PREFIX:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_ARCHDATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DOCS:C:/Qt/Docs/Qt-5.14.2 ... C:\Qt\5.14.2\msvc2017_64\bin> .\qmake -set ASDFTESTVARIABLE ABC C:\Qt\5.14.2\msvc2017_64\bin> .\qmake -query ASDFTESTVARIABLE:ABC QT_SYSROOT: QT_INSTALL_PREFIX:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_ARCHDATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DOCS:C:/Qt/Docs/Qt-5.14.2 ...
And there is a
qmake -unset
optionC:\Qt\5.14.2\msvc2017_64\bin> .\qmake -unset ASDFTESTVARIABLE C:\Qt\5.14.2\msvc2017_64\bin> .\qmake -query QT_SYSROOT: QT_INSTALL_PREFIX:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_ARCHDATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DATA:C:/Qt/5.14.2/msvc2017_64 QT_INSTALL_DOCS:C:/Qt/Docs/Qt-5.14.2
-
@SGaist the values that were set with
qmake -set
and had the old path were indeed in the windows registry, underComputer\HKEY_CURRENT_USER\SOFTWARE\QtProject\QMake
.I deleted them and it seems to have fixed the issue. Thank you all!
-
I just edited my recent reply, there is an
qmake -unset
option that removes the variable. Removing it in the Registry certainly works though too. -
And now I have another issue, after deleting the windows registry variables with regedit, it doesn't seem like qmake is able to initialise and assign them. After the
qmake -set
calls if I write this in the core.pro filemessage($$PWD) message($$[STARLAB]) message($$[NANOFLANN])
I get this output:
Project MESSAGE: C:/builds/starlab/core Project MESSAGE: Project MESSAGE:
And even by running
qmake.exe -query
inC:\Qt\5.12.12\msvc2017_64\bin
the variables don't show up. -
I resolved the issue by manually setting the variables with qmake in commad line in the
C:\Qt\5.12.12\msvc2017_64\bin
folder and checking in the Windows Registry if they were correctly initialised.