[Qt-creator] Code model could not parse, but compiled, iOS Framework

Eike Ziller Eike.Ziller at qt.io
Wed Jan 22 07:30:57 CET 2020

> On Jan 21, 2020, at 20:59, Jason H <jhihn at gmx.com> wrote:
> I'm trying to add OpenCV to a mobile app. Works fine on android, but on iOS Qt Creator is tell ing me it can't parse the included file.
> In the ios setion of the .pro:
> 	LIBS += -F$$PWD/ios -framework opencv2
> 	INCLUDEPATH+=$$PWD/ios/opencv2.framework/Headers  ((should I even need this?))
> The app is able to compile though. I copied opencv2.framework from the build location.
> I get the red errors in the code edit window of  "use of undeclared identifer 'cv'..."

> What do I need to do to make QtC/code model happy? (4.10.2) It seems that the framework directory structure ($$PWD/ios/opencv2.framework/Headers/*.hpp) breaks the #includes of opencv2/*.hpp

I just did the test by adding a “<qtdir>/lib/Foo.framework/Headers/foo.h” with “void foo();” in it to my Qt directory,
and adding
#include <foo/foo.h>
to a dummy Qt application.
The include works, and finds foo() too. (Qt Creator 4.11.0)

An include of <A/B.h> will look in all framework paths for “A.framework/Headers/B.h”.

- Check in Tools > C++ > Inspect C++ Code Model > Project Parts > Header Paths, that you have the path with openvc2.framework in it as a FrameworkPath listed.
- Does the editor complain about the include? Or is the include actually found, but other problems occur which lead to the symbols not being available?
- Do you have any code model warnings that do not show up inline in the editor? Look for a warning sign in the editor’s toolbar.

Br, Eike

> I tried to add a symlink:
> ln -s $$PWD/ios/opencv2.framework/Headers  $$PWD/ios/opencv2
> and changed: INCLUDEPATH+=$$PWD/ios
> And that worked, but I don't think I should have to provide a symlink?
> How should this work?

Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B

More information about the Qt-creator mailing list