Qt Creator Not Recognizing my own header file.
My .pri file called widgets.pri:
SOURCES += \
internal_lib/widgets/sheet_wp.cpp
HEADERS += \
internal_lib/widgets/sheet_wp.h
My .pro file has this include:
include(internal_lib/widgets/widgets.pri)
Everything was working fine but suddenly I get the following error:
error: C1083: Cannot open include file: 'internal_lib/widgets/sheet_wp.h': No such file or directory
Re: Qt Creator Not Recognizing my own header file.
You probably need a proper INCLUDEPATH as well. Or even that and also DEPENDPATH.
Re: Qt Creator Not Recognizing my own header file.
Yes, those are there but still not recognizing them:
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
Edit: Odd. I've removed the files and even added (existing) files, so that the .pri file does its auto stuff, it still doesn't recognize only that file (I have other files that are recognized fine).
Re: Qt Creator Not Recognizing my own header file.
How are you including the file in your sourcecode?
Re: Qt Creator Not Recognizing my own header file.
#include "internal_lib/widgets/sheet_wp.h"
Re: Qt Creator Not Recognizing my own header file.
How about this:
Code:
INCLUDEPATH += internal_lib/widgets
and then:
Code:
#include "sheet_wp.h"
Does it change anything?
Re: Qt Creator Not Recognizing my own header file.
No, it doesn't. Same error message. This project folder I had cloned from a git repository. I wonder if that has anything to do with it? When I open the .pro file for the first time, it asked whether I wanted to load the .user setting files (but it recommends that I don't) so I just clicked no.
The weird thing is that the code compiles fine on the computer that this project was originally created on.
Re: Qt Creator Not Recognizing my own header file.
Can we see the actual compiler invokation that fails?
Re: Qt Creator Not Recognizing my own header file.
error: C1083: Cannot open include file: 'internal_lib/widgets/sheet_wp.h': No such file or directory
Re: Qt Creator Not Recognizing my own header file.
compiler command, not error
Re: Qt Creator Not Recognizing my own header file.
I got this working. I don't know the exactly why it got it working, but I was reading the definition of PWD in the Qt Docs and a word that caught my eye in the definition was shadow build. I realized in the original project which did compile correctly was using shadow building, but the same project I loaded on a different computer was not using shadow building. Once I enabled shadow building (and this must be done when the pro file is loaded for the first time, not later on) it started compiling without errors. Thanks wysotta for your help.