Please nominate your Qt Champions for 2021!

Compilation error. Problem with paths.

  • After re-installing QtSDK 5.0.1 I got some strange thing. No project want to be compiled with the error like that
    @\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"debug" -I"." -I"." -I"....\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++" -o debug\main.o ..\sihvi\main.cpp
    g++.exe: error: ..sihvimain.cpp: No such file or directory
    g++.exe: fatal error: no input files@
    So why in command I have slash (\sihvi\main.cpp) and what the stuff is that sihvimain.cpp that doesn't exist anywhere?

  • I think you have '' in place of '/'. The backslash character is used to indicate the next character has special meaning (example \t is interpreted as the tab character).

    If you using MinGW I am almost certain that is uses a forward slash - even on Windows. The error makes sense at it doesn't understand \m and simply concatenates 'sihvi and main'.

  • So... I didn't have this problem yesterday. I compile it from Qt Creator, not manually from cmd.

  • I fired up windows and tried to compile an existing project using Qt4.8.1 and MinGW

    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/MinGW/MyProjects/autoupdate'
    /4.8.1/include/QtGui' -I'../../../Qt/4.8.1/include/QtXml' -I'../../../Qt/4.8.1/include/QtSql' -I'../../../Qt/4.8.1/include' -I'../../../Qt/4.8.1/include/ActiveQ
    t' -I'release' -I'../../../Qt/4.8.1/mkspecs/win32-g++' -o release/pcdmisstats.o src/pcdmisstats.cpp ...@

    Note: I have a batch file called 'make.bat' which calls 'mingw32-make'. Less typing...

    All of the path slashes are a forward slash and not a back slash. I know this is an older version of Qt but I don't think this is the reason.

    If you are using an IDE of some sort maybe the settings (library paths etc) are using the backslash and this ends up in the makefile? The contents of the makefile would be a good starting point to solve this problem.

  • Was this ever figured out? I have the same problem with Qt 5.0.1 and MinGW 4.7. Compiled it myself on Windows 7.

    If I navigate to the example qtbase\examples\widgets\graphicsview\boxes and run

    @ qmake && mingw32-make @

    it tosses an error saying it can't find 3rdpartyfbm.c (instead of 3rdparty/fbm.c, as it is written in the .pro). I generally do all my stuff in cmake and it works fine, but I ran into this in trying to compile any of the examples.

  • You can change "" to "/" as @Rondog said or add another "" to the path, something like this:
    Using only "" works sometimes and sometimes gives problems, it's better changing it.

Log in to reply