0

Take this for example

/usr/include/qt5/QtCore/qcoreapplication.h:43: error: QtCore/qglobal.h: No such file or directory
 #include <QtCore/qglobal.h>
                        ^

This is just come from a self generated code of Qt Creator nothing added.If I Ctrl+Click the header the compiler lead me to the file,so obviously it knows where it is.I am not using any of the Qt Library really,so I am not asking for a quick answer here all I have to do is to remove all Qt headers and problem solved. But more about why things like this happen all the time is it a bug?is it environment dependent? why a compiler always give error message that doesn't make any sense to anybody.How hard is it just get rid of nonsense like this at compiler level?

shadow_wxh
  • 366
  • 3
  • 17
  • 2
    It is perfectly normal to get unexpected error messages from time to time. You need to try to track down/diagnose the issue and try to understand what it is about; this way, you'll eventually develop a better comprehension that can help you deal with related future issues. There is just no way to universally resolve any unanticipated issue. In your particular case, it might help if you understand that Qt creator and the compiler are completely separate components, the former just invokes the latter when you hit the build button... – Mike May 14 '19 at 20:03
  • 1
    You can start tracking this down by writing a minimal hello world Qt example (with a minimal `qmake` file) and see if it compiles, and then try to develop the example step by step until you reproduce the issue, but it definitely looks like an environment-related problem... – Mike May 14 '19 at 20:06
  • 1
    To add, just because the IDE sees the file doesn't mean that the compiler also sees the file. So the error message does make a little intuitive sense. – TrebledJ May 16 '19 at 15:31
  • A self generated code from an IDE using its own library compiled by its own compiler yet require a programmer to guide it to its every single file.yep that make perfect sense╮(╯_╰)╭ – shadow_wxh May 16 '19 at 17:20

0 Answers0