cannot find file if the file is in another directory.
-
wrote on 23 Feb 2016, 10:23 last edited by
folks, in my project some files are in another directory but not in the directory where main is. Weird enough, I successfully compiled it days ago, this morning I tried it again and it failed to compile. Qt creator says: "cannot find xxx.h, no such file".
I've included all the head files with double quotation marks "", and all the files are in my project tree.
any suggestion how to fix this?
-
folks, in my project some files are in another directory but not in the directory where main is. Weird enough, I successfully compiled it days ago, this morning I tried it again and it failed to compile. Qt creator says: "cannot find xxx.h, no such file".
I've included all the head files with double quotation marks "", and all the files are in my project tree.
any suggestion how to fix this?
wrote on 23 Feb 2016, 10:33 last edited by koahnig@qtpi said:
cannot find xxx.h, no such file
Is it a message from Qt creator or from the compiler?
I guess the latter one.If your include statements are now in your source file:
#include ""xxx.h""that is definitely wrong. You need duplicated quotation marks for string definitions, but not for ordinary code.
-
folks, in my project some files are in another directory but not in the directory where main is. Weird enough, I successfully compiled it days ago, this morning I tried it again and it failed to compile. Qt creator says: "cannot find xxx.h, no such file".
I've included all the head files with double quotation marks "", and all the files are in my project tree.
any suggestion how to fix this?
wrote on 23 Feb 2016, 10:37 last edited by -
wrote on 23 Feb 2016, 11:05 last edited by kenchan
Can you see something like this in your pro file/
SOURCES +=
mydirectory/myfile.cpp \
mydirectory/myotherfile.cppif not edit it by hand or select your files into the project again.
-
i understand what you mean. and i know the difference between "" and <>.
but my question is do i need to always include a absolute path like c:/qt/file/xxx.h? simply "xxx.h" not gonna work?
wrote on 23 Feb 2016, 11:08 last edited by kenchanThen again for include paths you can use this
INCLUDEPATH += myincludedirectory \
myotherincludedirectoryetc...
-
wrote on 23 Feb 2016, 11:18 last edited by
hi,you can click right >add existing files and add header and cpp files for classes.
now you should add #inlcude <> files and directories. -
Then again for include paths you can use this
INCLUDEPATH += myincludedirectory \
myotherincludedirectoryetc...
1/8