Constant errors and missing files
-
After several instalations on both my laptop and PC I am still having troubles with clangd telling me that I am missing files.
For example
main.cpp:1:10: 'iostream' file not foundor
main.cpp:9:5: Use of undeclared identifier 'cin' (on a code that I have checked with online c++ compiler and it worked flawlessly)It is my first compiler on this PC, I did not install Visual Studio or any other compiler, I have tried using tutorials on how to properly install Qt Creator and tried manually and automatically select files on installer to no avail.
-
After several instalations on both my laptop and PC I am still having troubles with clangd telling me that I am missing files.
For example
main.cpp:1:10: 'iostream' file not foundor
main.cpp:9:5: Use of undeclared identifier 'cin' (on a code that I have checked with online c++ compiler and it worked flawlessly)It is my first compiler on this PC, I did not install Visual Studio or any other compiler, I have tried using tutorials on how to properly install Qt Creator and tried manually and automatically select files on installer to no avail.
-
@SmoothG
To be 100% clear: these errors are seen only while you are editing, if you try actually running the compiler (on your machine, not online checker) the header file is found OK? -
All of sudden I can't run projects (the button is greyed out). The header file when running projects before was found OK but now I can't even run projects. Before errors appeared mainly when trying to load projects that I've made before
@SmoothG said in Constant errors and missing files:
I can't run projects
Run qmake again. Or, if it's CMake project, load the project again.
-
After several instalations on both my laptop and PC I am still having troubles with clangd telling me that I am missing files.
For example
main.cpp:1:10: 'iostream' file not foundor
main.cpp:9:5: Use of undeclared identifier 'cin' (on a code that I have checked with online c++ compiler and it worked flawlessly)It is my first compiler on this PC, I did not install Visual Studio or any other compiler, I have tried using tutorials on how to properly install Qt Creator and tried manually and automatically select files on installer to no avail.
@SmoothG said in Constant errors and missing files:
It is my first compiler on this PC, I did not install Visual Studio or any other compiler
what is your first compiler ? QtCreator ? Because Creator is no compiler it's just an IDE and a Qt is only a library. You will need a compiler from somewhere!!!
There is an option to also download and install mingw when you launch the QtInstaller. That is the windows version of the gnu compiler but it only works with the mingw versions of the Qt Library.
-
@SmoothG said in Constant errors and missing files:
I can't run projects
Run qmake again. Or, if it's CMake project, load the project again.
-
@jsulm
I selected MinGW while installing qt creator. It says that there are missing files and errors when I start new project or load old one but it compiles just fine@SmoothG said in Constant errors and missing files:
It says that there are missing files and errors when I start new project or load old one
Those errors probably come from code model which sometimes produces wrong errors. Also, in some cases it can help to just build the project.
-
@SmoothG said in Constant errors and missing files:
It says that there are missing files and errors when I start new project or load old one
Those errors probably come from code model which sometimes produces wrong errors. Also, in some cases it can help to just build the project.
-
@jsulm
Building did not help there are still errors but code works fine.
I couldn't run projects because I only opened main.cpp files@SmoothG said in Constant errors and missing files:
because I only opened main.cpp files
And how should QtCreator know where to look for the include files then?
-
@jsulm
Building did not help there are still errors but code works fine.
I couldn't run projects because I only opened main.cpp files@SmoothG said in Constant errors and missing files:
I couldn't run projects because I only opened main.cpp files
Well, of course. You need to open the project file (either *.pro file or CMakeLists.txt)...