[Qt-creator] Code completion doesn't work with ClangCodeModel

Yang Fan missdeer at gmail.com
Tue Jan 14 01:56:04 CET 2014


Hi,

I have dumpped the error messages, seemly it's caused by the Qt 5.2
binaries. I'm using the binaries downloaded from
http://qt-project.org/downloads.

*** Reparse for highlighting took 481 ms.
"error" "/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtCore/qglobal.h"
[996:4(33790)] ""You must build your code with position independent code if
Qt was built with -reduce-relocations. "         "Compile your code with
-fPIC or -fPIE."
  in file included from /home/tvu/Shareware/istkani/src/main.cpp:1:
  in file included from /home/tvu/Shareware/istkani/src/main.cpp:1:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtWidgets/QApplication:1:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtWidgets/qapplication.h:45:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtCore/qcoreapplication.h:45:"
"error" "/opt/intel/composer_xe_2013.0.079/compiler/include/math.h"
[27:3(742)] ""This Intel <math.h> is for use with only the Intel compilers!"
  in file included from /home/tvu/Shareware/istkani/src/main.cpp:1:
  in file included from /home/tvu/Shareware/istkani/src/main.cpp:4:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtQml/QtQml:3:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtQml/QtQmlDepends:2:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtCore/QtCore:65:
  in file included from
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtCore/qmath.h:49:"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [46:5(1373)] "no member
named 'QDir' in 'QFont'"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [57:10(1716)] "use of
undeclared identifier 'dir'; did you mean 'div'?
  'div' declared here"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [57:10(1716)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [57:14(1720)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [59:9(1792)] "use of
undeclared identifier 'dir'; did you mean 'div'?
  'div' declared here"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [59:9(1792)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [59:13(1796)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [60:9(1812)] "use of
undeclared identifier 'dir'; did you mean 'div'?
  'div' declared here"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [60:9(1812)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [60:13(1816)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [61:28(1872)] "use of
undeclared identifier 'dir'; did you mean 'div'?
  'div' declared here"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [61:28(1872)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
"error" "/home/tvu/Shareware/istkani/src/main.cpp" [61:32(1876)] "member
reference base type 'div_t (int, int) throw()' is not a structure or union"
*** Highlighting took 491 ms in total.
*** Fast re-indexing took 0 ms in total.
/home/tvu/Qt5.2.0/5.2.0/gcc_64/include/QtCore/qglobal.h:996:4: error: "You
must build your code with position independent code if Qt was built with
-reduce-relocations. "         "Compile your code with -fPIC or -fPIE."
/opt/intel/composer_xe_2013.0.079/compiler/include/math.h:27:3: error:
"This Intel <math.h> is for use with only the Intel compilers!"
/home/tvu/Shareware/istkani/src/main.cpp:48:5: error: no member named
'QDir' in 'QFont'
/home/tvu/Shareware/istkani/src/main.cpp:57:10: error: use of undeclared
identifier 'dir'
/home/tvu/Shareware/istkani/src/main.cpp:59:9: error: use of undeclared
identifier 'dir'
/home/tvu/Shareware/istkani/src/main.cpp:60:9: error: use of undeclared
identifier 'dir'
/home/tvu/Shareware/istkani/src/main.cpp:61:28: error: use of undeclared
identifier 'dir'
... Completion done in 3313 ms, with 146 items.



On Mon, Jan 13, 2014 at 6:07 PM, Erik Verbruggen
<erik.verbruggen at digia.com>wrote:

> On 11-1-2014 3:07, Yang Fan wrote:
> > Hi,
> >
> > I have built the ClangCodeModel plugin successfully with Qt5.2 on Mac OS
> > X 10.9 and on Debian Wheezy, but after I enabled the plugin and selected
> > the Code Model in Preference dialog, the code completion feature doesn't
> > work. When I typed a dot follows an object name, no candidate list
> > appears. Any suggestion?
>
> Can you run with the environment variable QTC_CLANG_VERBOSE set (value
> doesn't matter), and check stdout? That should show the libclang
> invocations plus any errors while parsing.
>
> -- Erik.
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>



-- 
Regards,
Fan Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140114/11eaac23/attachment.html>


More information about the Qt-creator mailing list