User forums > Help
Unable to compile ClangCompletion cbplugin
astrapi:
I've juste some little problem, I've tried and successfully build :
https://github.com/yvesdm3000/ClangLib
https://github.com/alpha0010/ClangLib/tree/threads (the thread branch ... even if I don't understand what that mean)
These 2 built and I've got my .so and .zip, codeblocks reconize them but they don't auto complete auto and shared_ptr better than the auto completion plugin basic
With the one of tim_s it's an other story. It works ! I've try with nopch and usepch (I don't know what that mean ever), the result is the same :
He complete auto and shared_ptr (YAHOUU !!) BUT, I've note access to (doxy)documentation anymore
And if I tick parse documentation of the code assistance plugin, he didn't save it...
Same for disaling diagnostic he don't listen to me, maybe there is something to do the other file compiled : .xrc .xrc and .xml ?
And I can't see (sometime) the bar completion with the name of fonctions and class... And sometimes he didn't complete... Why why why ? :o
I surely did something wrong but what ?
yvesdm3000:
Don't forget to disable the builtin code-completion. Sometimes you don't know which one the main C::B app will choose to make the code-completion.
No problem here with std::shared_ptr<>. The only thing is that you have to make sure you have the correct headers included and a drawback of any clang-based code-completion is that the code up to your std::shared_ptr use should have code that can be compiled without errors. That's a reason why we also have the inline diagnostics to make that possible.
For configuring the diagnostics, there are some fixes ready in the 'staging' branch and that branch is almost ready to be merged into master. It should be good enough right now for you to test. I just happen to commit a fix for the semantic occurrences highlight an hour ago.
Yves
astrapi:
I've download the staging brank there : https://github.com/yvesdm3000/ClangLib/tree/staging
And I got these errors :
translationunit.h:54 assert( first.m_id == second.m_Id ); //I suppose
--- Code: ---[color=green]ClangLib-staging/clangproxy.cpp||In function ‘wxString HTML_Writer::Escape(const wxString&)’:|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|276|error: ambiguous default type conversion from ‘wxString::const_iterator::reference {aka wxUniChar}’|[/color]
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|276|note: candidate conversions include ‘wxUniChar::operator char() const’ and ‘wxUniChar::operator unsigned char() const’|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp||In function ‘wxString HTML_Writer::SyntaxHl(const wxString&, const std::vector<wxString>&)’:|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|318|error: operands to ?: have different types ‘wxUniChar’ and ‘wchar_t’|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|318|note: and each type can be converted to the other|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|319|error: operands to ?: have different types ‘wxUniChar’ and ‘wchar_t’|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|319|note: and each type can be converted to the other|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp||In member function ‘void ClangProxy::RemoveTranslationUnit(ClTranslUnitId)’:|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|760|error: use of deleted function ‘ClTranslationUnit& ClTranslationUnit::operator=(const ClTranslationUnit&)’|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/translationunit.h|30|note: ‘ClTranslationUnit& ClTranslationUnit::operator=(const ClTranslationUnit&)’ is implicitly declared as deleted because ‘ClTranslationUnit’ declares a move constructor or move assignment operator|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp||In member function ‘void ClangProxy::GetFunctionScopes(ClTranslUnitId, const wxString&, std::vector<std::pair<wxString, wxString> >&)’:|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|1762|error: no matching function for call to ‘make_pair(const wxString&, const wxString&)’|
/usr/include/c++/5/bits/stl_pair.h|276|note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)|
/usr/include/c++/5/bits/stl_pair.h|276|note: template argument deduction/substitution failed:|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|1762|note: cannot convert ‘it.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator-><const ClFunctionScope*, std::vector<ClFunctionScope> >()->ClFunctionScope::scopeName’ (type ‘const wxString’) to type ‘wxString&&’|
||=== Build failed: 5 error(s), 21 warning(s) (0 minute(s), 55 second(s)) ===|
--- End code ---
(Thanks to help !)
stahta01:
Here is how I got past the wxWidgets 3.0 errors; Note, I thought you needed to use wxWidgets 2.8.
NOTE: I am NOT sure [if] this is the correct or even valid runtime fix for the compiler error!!
Tim S.
--- Code: ---diff --git a/clangproxy.cpp b/clangproxy.cpp
index e6d840b..ff14c0b 100644
--- a/clangproxy.cpp
+++ b/clangproxy.cpp
@@ -273,7 +274,7 @@ static wxString Escape(const wxString& text)
for (wxString::const_iterator itr = text.begin();
itr != text.end(); ++itr)
{
- switch (*itr)
+ switch (wxChar(*itr))
{
case wxT('&'):
html += wxT("&");
@@ -315,8 +316,8 @@ static wxString SyntaxHl(const wxString& code, const std::vector<wxString>& cppK
const int codeLen = code.Length();
for (int enRg = 0; enRg <= codeLen; ++enRg)
{
- wxChar ch = (enRg < codeLen ? code[enRg] : wxT('\0'));
- wxChar nextCh = (enRg < codeLen - 1 ? code[enRg + 1] : wxT('\0'));
+ wxChar ch = (enRg < codeLen ? wxChar(code[enRg]) : wxT('\0'));
+ wxChar nextCh = (enRg < codeLen - 1 ? wxChar(code[enRg + 1]) : wxT('\0'));
switch (style)
{
default:
--- End code ---
astrapi:
Oups... You're right....
But how can I knew that it was for wx-3.0 and not 2.8 ?
It helps at least ? (a bit)
If I put wx-config --version=2.8 it will not work ? (no it doesn't...)
But you are (Yves and Tim S, the best version of clanglib that I can found isn't it ?)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version