Solved using Creator as editor/code browser
-
Hi all -
In addition to using Creator to write Qt apps, I use it for other programs as well. (After all, it is the best IDE in the world.) Normally it works fine, but I'm trying to use it with the Espressif esp-idf, and it's giving me some problems. Here's an example:
The red circles are for this error message:*ip_addr.h:40:10: error: 'lwip/opt.h' file not found*
But if I click on the filename, and hit F2, it takes me to the file.
The path to the file is in my project file, so that's not the problem.
Any ideas? This is just one small example, but I think if I can get to the bottom of this, I can fix a lot of the other similar problems.
Thanks...
-
Anyone have an idea?
-
So you are using a Generic Project?
Have you set up the
.includes
file correctly?Regards
PS: I'm doing very similar things as you with Creator ;)
-
@aha_1980 I wasn't aware of the generic project option. This is excellent stuff. Is there a way to use QMake variables in the includes file?
-
-
None in particular; just curious.
I do use a couple functions (setenv and tzset) that are hidden in time.h with STRICT_ANSI. Qt raises an error, though it compiles. Can you think of a setting I can use to fix this? This isn't a big deal; just a convenience.
-
Hi @mzimmers,
if you just want to set a define, you can do so in the
.config
file, just like in code:#define FOO 42
I use that to hide embedded compiler specific stuff from the editor.
But that is all I'm aware of.
Regards
-
@mzimmers said in using Creator as editor/code browser:
Espressif esp-idf
But. AFAIK, the ESP32 SDK use the CMake. So, is it not option for you? Because as I understand, the CMakePM should correct highlight the includes and macros.. No?
-
-
@mzimmers said in using Creator as editor/code browser:
but I'm not sure I get your point. I'm not really familiar with CMake
I meant that you can try to use the CMake for your project (instead of qmake or a generic project import). In this case you can even build your project with CMake, and in this case the QtCreator should highlight the sources correctly.
As an option, you can try to disable the clang-code-model plugin, because it is buggy.
PS: For example I personally for our projects use the QBS (even for Espressif ESP8266 chip). And the QtCreator highlight the sources correctly then (but I don't use the clang-code-model, if to be honest).
-
My project does use CMake -- I just don't invoke it via Qt Creator; I use the esp-idf command interface for that. It would be great to be able to build from Creator, but that's the next step.
Perhaps I wasn't clear -- Creator is (now) correctly highlighting the source. I needed to work with the .includes file, but got it working.
From this page:
__STRICT_ANSI__ GCC defines this macro if and only if the -ansi switch, or a -std switch specifying strict conformance to some version of ISO C or ISO C++, was specified when GCC was invoked. It is defined to ‘1’. This macro exists primarily to direct GNU libc’s header files to use only definitions found in standard C.
So maybe I should modify my .cxxflags file to match whatever settings the IDF toolchain uses?