Code::Blocks Forums

User forums => Help => Topic started by: astrapi on March 19, 2016, 01:34:36 am

Title: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 19, 2016, 01:34:36 am
Hello everybody !

I've found greatfull healp here, so I tried again !

I'm trying to built the clangcompletion plugin for codeblocks.
I've download this --> https://github.com/Lalaland/ClangComplete (https://github.com/Lalaland/ClangComplete)

I open it with my newlly installed codeblocks ( ;) ) , but I've got this error :

||=== Build: default in ClangComplete (compiler: GNU GCC Compiler) ===|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.h||In member function ‘wxArrayString ClangComplete::GetCallTips()’:|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.h|71|warning: no return statement in function returning non-void [-Wreturn-type]|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp||In function ‘wxString generateCommandString(ProjectFile*)’:|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|130|error: invalid initialization of reference of type ‘const CompilerTool&’ from expression of type ‘const CompilerTool*’|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|132|error: ‘class Compiler’ has no member named ‘GenerateCommandLine’|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|130|warning: unused variable ‘tool’ [-Wunused-variable]|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp||In member function ‘CXCodeCompleteResults* ClangComplete::getResults(cbEditor*, cbStyledTextCtrl*)’:|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|308|warning: narrowing conversion of ‘length’ from ‘int’ to ‘long unsigned int’ inside { } [-Wnarrowing]|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|317|warning: unused variable ‘status’ [-Wunused-variable]|
/usr/include/codeblocks/cbplugin.h||In instantiation of ‘static cbPlugin* PluginRegistrant<T>::CreatePlugin() [with T = ClangComplete]’:|
/usr/include/codeblocks/cbplugin.h|1109|required from ‘PluginRegistrant<T>::PluginRegistrant(const wxString&) [with T = ClangComplete]’|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.cpp|70|required from here|
/usr/include/codeblocks/cbplugin.h|1116|error: invalid new-expression of abstract class type ‘ClangComplete’|
/home/astrapi/.lib/codeBlocks/ClangComplete-master/ClangComplete.h|28|note:   because the following virtual functions are pure within ‘ClangComplete’:|
/usr/include/codeblocks/cbplugin.h|822|note:     virtual cbCodeCompletionPlugin::CCProviderStatus cbCodeCompletionPlugin::GetProviderStatusFor(cbEditor*)|
/usr/include/codeblocks/cbplugin.h|869|note:     virtual std::vector<cbCodeCompletionPlugin::CCToken> cbCodeCompletionPlugin::GetAutocompList(bool, cbEditor*, int&, int&)|
/usr/include/codeblocks/cbplugin.h|881|note:     virtual wxString cbCodeCompletionPlugin::GetDocumentation(const cbCodeCompletionPlugin::CCToken&)|
/usr/include/codeblocks/cbplugin.h|902|note:     virtual std::vector<cbCodeCompletionPlugin::CCCallTip> cbCodeCompletionPlugin::GetCallTips(int, int, cbEditor*, int&)|
/usr/include/codeblocks/cbplugin.h|914|note:     virtual std::vector<cbCodeCompletionPlugin::CCToken> cbCodeCompletionPlugin::GetTokenAt(int, cbEditor*, bool&)|
/usr/include/codeblocks/cbplugin.h|925|note:     virtual wxString cbCodeCompletionPlugin::OnDocumentationLink(wxHtmlLinkEvent&, bool&)|
||=== Build failed: 3 error(s), 7 warning(s) (0 minute(s), 5 second(s)) ===|



reference to this part of code :
Code
const CompilerTool &tool = comp->GetCompilerTool(ctCompileObjectCmd,_(".cpp"));
    wxString tempCommand = _("$options $includes");
    comp->GenerateCommandLine(tempCommand,target,file,UnixFilename(pfd.source_file_absolute_native),Object,pfd.object_file_flat,
                              pfd.dep_file);
    return tempCommand;


If someone see the problem...

I'm with Starting Code::Blocks Release 16.01  rev 10760 Feb  2 2016, 03:11:29 - wx2.8.12 (Linux, unicode) - 64 bit
On ubuntu


Title: Re: Unable to compile ClangCompletion cbplugin
Post by: Alpha on March 19, 2016, 02:28:49 am
You may want to try https://github.com/yvesdm3000/ClangLib.  That is where active development is.  The project file probably needs to be tweaked to remove absolute paths first though.

If you run into problems with it, you could alternatively try https://github.com/alpha0010/ClangLib/tree/threads (threads branch).
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 19, 2016, 08:50:51 am
Wonderful I try all this as soon as possible, thanks !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 19, 2016, 09:59:29 am
Sorry sorry, surely that's look better, but I load the clanlib.cdb (unix)
and I have this error

Scanned 0 files for #includes, cache used 0, cache updated 0
g++-5 -DBUILDING_PLUGIN -O3 -Wextra -Wall -std=c++0x -ansi (invalid) -I/usr/lib/llvm-3.4/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -Wall -std=c++0x -std=c++11 -std=c++14 -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/lib/llvm-3.4/include/ -I. -I../codeblocks-1510/src/include -c /home/astrapi/.lib/codeBlocks/ClangLib-master/cclogger.cpp -o .objs/plugins/clanglib/cclogger.o

/bin/sh: 1: Syntax error: "(" unexpecte


Certainly it's not terrible... But I don't know what to  do...

In the build option I see that there was a relative path to ..codeblockas-16.01/sdk/wxscintilla but I don't have this lib, and I can't see what thing I'v got to install... (it's really obscure all this for me...)

Thanks again for helping!
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 19, 2016, 02:53:02 pm
You have this "(invalid)" in the command which means that you have not defined a global variable.
Go to the settings -> global variables and define it.
Then rebuild.
Also clean up all the -std and ansi option. You have almost all of them in a single command which is not good.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 19, 2016, 04:43:45 pm
Oye oye oye...
It's in progress ! I've set a folder to my global variable (but I don't know what it is)
After little probleme of include I've got this :




-------------- Build: Release in clanglib (Unix) (compiler: GNU GCC Compiler)---------------

g++-5 -DBUILDING_PLUGIN -O3 -Wextra -Wall -std=c++0x -ansi /home/astrapi/.lib/codeBlocks -I/usr/lib/llvm-3.4/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -Wall -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/lib/llvm-3.4/include/ -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0/ -I. -I../codeblocks-1510/src/include -c /home/astrapi/.lib/codeBlocks/ClangLib-master/cclogger.cpp -o .objs/plugins/clanglib/cclogger.o
In file included from /usr/include/wx-3.0/wx/string.h:24:0,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-master/cclogger.h:9,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-master/cclogger.cpp:10:
/usr/include/wx-3.0/wx/defs.h:46:13: error: #error "No Target! You should use wx-config program for compilation flags!"
 #           error "No Target! You should use wx-config program for compilation flags!"


My other compilations options of the built program :

$(#CB_RELEASE_TYPE)
`wx-config --version=2.8 --cflags`
-I`llvm-config --includedir`
-fmessage-length=0
-fexceptions
-Winvalid-pch
-fPIC
-pthread


I'm all yours
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 19, 2016, 06:11:47 pm
What is the output of "wx-config --version=2.8 --cflags" if you run it in a console?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 19, 2016, 06:36:03 pm
Code
✔ astrapi 18:34:21 ~ ▶ wx-config --version=2.8 --cflags

          Warning: No config found to match: /usr/bin/wx-config --version=2.8 --cflags
                   in /usr/lib/x86_64-linux-gnu/wx/config
          If you require this configuration, please install the desired
          library build.  If this is part of an automated configuration
          test and no other errors occur, you may safely ignore it.
          You may use wx-config --list to see all configs available in
          the default

✘ astrapi 18:34:44 ~ ▶ which wx-config
/bin/wx-config
✔ astrapi 18:34:54 ~ ▶ wx-config --list

    Default config is gtk2-unicode-3.0

  Default config will be used for output

  Alternate matches:
    base-unicode-3.0


Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 20, 2016, 02:04:24 am
The Plugin seems to not yet support wxWidgets 3.0.

Does your Code::Blocks installation use wxWidgets 3.0? (yes or no)
Do you or can you self-build Code::Blocks? (yes,no,maybe)

I have forked one of the Git Repos listed above and I am doing changes in this location https://github.com/stahta01/ClangLib/tree/build/tim_s (https://github.com/stahta01/ClangLib/tree/build/tim_s)

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 02:43:03 am
So, for my codeblocks version :

✔ astrapi 18:40:50 ~ ▶ codeblocks -v
Starting Code::Blocks Release 16.01  rev 10760 Feb  2 2016, 03:11:29 - wx2.8.12 (Linux, unicode) - 64 bit


Can I "down"date my wx-config to wx2.8 ? (does this question have a sense ?)

I think I can probably built codeblocks, with some probleme maybe.

I try to built right now your clanglib, thank you a lot !
(Codeblocks at start up of your project clanglib wx3.0.x ask me Global variable editor current variable cb, I don't what that mean, is this important ?)

I've got this error
-------------- Build: use_pch in clanglib  wx3.0.x - Unix (compiler: GNU GCC Compiler)---------------

g++-5 -DBUILDING_PLUGIN -DCB_PRECOMP -DWX_PRECOMP -O3 -Wextra -Wall -std=c++0x -ansi -fPIC /home/astrapi/.lib/codeBlocks -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I/usr/lib/llvm-3.4/include -fmessage-length=0 -fexceptions -Winvalid-pch -pthread -DcbDEBUG -Wall -std=c++11 -std=c++14 -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/lib/llvm-3.4/include/ -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0/ -I/usr/include/codeblocks/wxscintilla/include -c /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangccsettingsdlg.cpp -o .objs/plugins/clanglib/clangccsettingsdlg.o
In file included from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/translationunit.h:5:0,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangproxy.h:11,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangplugin.h:9,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangccsettingsdlg.cpp:39:
/usr/include/clang-c/Documentation.h:40:3: error: conflicting declaration ‘typedef struct CXComment CXComment’
 } CXComment;


reference to that part of code :
Code
/**
 * \brief A parsed comment.
 */
typedef struct {
  const void *ASTNode;
  CXTranslationUnit TranslationUnit;
} CXComment;

Thanks again !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 20, 2016, 04:44:43 am
I have NOT fixed the Linux wxWidgets 2.8 CB Project, yet.

I will work on it when I have time.

The CB Global variable points to the location in which I self-built Code::Blocks.
I ask questions in order to get answers.
Edit2: I am thinking your answer counts as maybe; after I re-read it a second time.
Since, your CB is already using wxWidgets 2.8.x; self building Code::Blocks is NOT the best solution for you.
But, I can NOT test the changes needed in the wxGTK28 Unix project. I will post in this thread when I think I have a CB Project for your to test.

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 20, 2016, 07:55:15 am
Thanks for making a wx30 project. Don't forget to make a pull-request back.

Maybe I could backport the wx30 project to wx28 and make all paths relative properly?

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 11:01:39 am
What I understand is that you are working on it, so I wait for you and it will be ok.

Wonderful thank you very much (I am the only one with this problem ? )

Just for understand better, I can't install clangplugin because my version of wxWidgets is higher than the one
the clanglib plugin uses ?

Thank you guys with skills , without you, Linux and open source softwares couldn't exist !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 20, 2016, 02:31:38 pm
What I understand is that you are working on it, so I wait for you and it will be ok.

Wonderful thank you very much (I am the only one with this problem ? )

Just for understand better, I can't install clangplugin because my version of wxWidgets is higher than the one
the clanglib plugin uses ?

Thank you guys with skills , without you, Linux and open source softwares couldn't exist !

You are on an LInux system using wxWidgets 2.8.x; like the person doing the most recent plugin updates.
I am on the newer version of wxWidgets 3.0.x; so, I have the newer version.
I am going to attach an CB Project for yvesdm3000 to test. Along with an NOPCH patch.
Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 20, 2016, 02:44:59 pm
Thanks for making a wx30 project. Don't forget to make a pull-request back.

Maybe I could backport the wx30 project to wx28 and make all paths relative properly?

Yves
Linking to wxGTK2.8 untested CB Project. https://github.com/stahta01/ClangLib/blob/build/tim_s/clanglib_wxGTK28-unix.cbp (https://github.com/stahta01/ClangLib/blob/build/tim_s/clanglib_wxGTK28-unix.cbp)
And, attaching NOPCH patch; the above project is a NOPCH project for default target.

FYI: My wxGTK3.0 project crashes CB when I try to install the plugin.
I removed the -pthread option to see if the crash went away; it did NOT. You will likely need to add that option back.

I am still at advance beginner on using Git; once I get the code to work right. I will apply my patch to the master branch and try to do a pull-request.

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 02:52:59 pm
Ok, so I think I understand some part of you say.
But what is a NOPCH patch ?

You said  you have the newer version of wxWidgets3.0.x so does that mean that your codeblocks is built with too ?
(The computer can't use an older version for a software and a new for an other does he ?)

Code
✔ astrapi 14:47:00 ~ ▶ wx-config --libs all
-L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_stc-3.0 -lwx_gtk2u_richtext-3.0 -lwx_gtk2u_ribbon-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_aui-3.0 -lwx_gtk2u_gl-3.0 -lwx_gtk2u_media-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
✔ astrapi 14:47:18 ~ ▶
Does this not mean I'm yousing wxWidgets3.0 ?

But I know that my codeblocks is using wxWidgets2.8.x :
Code
✔ astrapi 14:47:18 ~ ▶ codeblocks -v
Starting Code::Blocks Release 16.01  rev 10760 Feb  2 2016, 03:11:29 - wx2.8.12 (Linux, unicode) - 64 bit

I'm a bit confuse... If you don't want explain me no problem, I will do what you say I understand.

You add an answere during my righting, I try to built later (if I have to, I don't understand very well sorry...)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 20, 2016, 03:28:38 pm
To build the plugin you need to built it against the wx2.8.
To do so you need to install the dev/devel package for wxgtk 2.8.
Obviously you have the runtime wxgtk-2.8 packages. You just need to install the development packages.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 03:34:51 pm
Ok I'll try this in a moment ! Thanks everybody !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 05:59:44 pm
Arh ! I'm surely miss something...

I've install libwxgtk2.8-dev, so now I-ve got the header files, I remove the `wx-config --cflags` because I've
got the gtk3.0 install so it gives only include for it. And put by hand the flags and include that I think is needed.
(I hope this plugin is very good....)

I try to built it again... and got the same error (maybe it's normal I've just don't understand somethingsss ?)

Code
-------------- Build: default in clanglib  wx2.8.x - Unix (compiler: GNU GCC Compiler)---------------

g++-5 -I/usr/include/codeblocks -I/usr/include/codeblocks/tinyxml -I/usr/include/codeblocks/scripting/include -I/usr/include/codeblocks/scripting/bindings -I/usr/include/codeblocks/scripting/sqplus -I/usr/include/codeblocks/wxscintilla/include -DBUILDING_PLUGIN -DNOPCH -Wextra -Wall -std=c++0x -ansi -fPIC /home/astrapi/.lib/codeBlocks -I/usr/lib/llvm-3.4/include -fmessage-length=0 -fexceptions -Winvalid-pch -pthread -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DcbDEBUG -Wall -std=c++11 -std=c++14 -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/include/wx-2.8/ -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8/ -I/usr/include/codeblocks/wxscintilla/include/ -c /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangccsettingsdlg.cpp -o .objs/plugins/clanglib/clangccsettingsdlg.o
In file included from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/translationunit.h:5:0,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangproxy.h:11,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangplugin.h:9,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangccsettingsdlg.cpp:39:
/usr/include/clang-c/Documentation.h:40:3: error: conflicting declaration ‘typedef struct CXComment CXComment’
 } CXComment;
   ^
In file included from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/translationunit.h:4:0,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangproxy.h:11,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangplugin.h:9,
                 from /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/clangccsettingsdlg.cpp:39:
/usr/lib/llvm-3.4/include/clang-c/Index.h:2149:3: note: previous declaration as ‘typedef struct CXComment CXComment’
 } CXComment;

What do I miss ?

Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 20, 2016, 06:16:08 pm
It seems that you have two different versions of clang/llvm.
Is this the case?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 06:59:05 pm
Maybe it is right because I built it and install it with apt-get (because the making didn't make me a .so I think)...
How can I remove something that I built ? I've make a little mess I think...

That's right I've llvm-3.4 AND 3.8 installed but the .so is 3.8, or maybe there is only clang witch is doubled but not
llvm that I only find in 3.4... If that make a sense... ( :-[ )
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 20, 2016, 07:11:20 pm
It depends how you've installed it.
You can use either make uninstall or rm -rf /path/where/it/is installed.
If you use the second you should be very careful what you delete!
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 07:14:50 pm
I've kept the folder where is the source of llvm 3.8 but make uninstall doesn't work...
I'm a bit afraid of rm things but I'm on it

I've remove the files that I was 3.8.0 but the error remain (surely problem of lib that I didn't delete) Maybe I remove
everythink about clang and llvm and reinstall it from apt-get ?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: oBFusCATed on March 20, 2016, 07:59:48 pm
Maybe I remove everythink about clang and llvm and reinstall it from apt-get ?
This is a good option.
Also keep in mind that you have to restart cb after you fiddle with packages that change the output of pkg-config/wx-config or llvm-config.
This is needed because cb caches the output of such tools and doesn't execute them each time.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 20, 2016, 08:10:16 pm
Haaaa very good to know that indeed, I'm on it ! Thanks ! (I feel that we are going the right way !)


I still have something I don't understand :
Code
-------------- Build: default in clanglib  wx2.8.x - Unix (compiler: GNU GCC Compiler)---------------

g++-5 -shared -L/usr/lib .objs/plugins/clanglib/cclogger.o .objs/plugins/clanglib/clangcc.o .objs/plugins/clanglib/clangccsettingsdlg.o .objs/plugins/clanglib/clangdiagnostics.o .objs/plugins/clanglib/clangplugin.o .objs/plugins/clanglib/clangproxy.o .objs/plugins/clanglib/clangtoolbar.o .objs/plugins/clanglib/tokendatabase.o .objs/plugins/clanglib/translationunit.o .objs/plugins/clanglib/treemap.o  -o devel/clanglib.so /usr/lib/llvm-3.4/lib -Wl,--no-undefined -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -lcodeblocks    -lcodeblocks -lclang
/usr/bin/ld: ne peut pas trouver /usr/lib/llvm-3.4/lib: Format de fichier non reconnu
/usr/bin/ld: ne peut trouver -lclang
collect2: error: ld returned 1 exit status

I've reinstall clang clang-dev llvm llvm-dev

/usr/lib/llvm-3.4/lib exist, there is lot of file in it, some .so and some .a
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 01:21:56 am
It's impossible to built...  :'( I just can't do it  :'( I go to sleep, I'll be back !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 21, 2016, 03:18:55 am
I also never tried against LLVM 3.4, only LLVM 3.6 (Centos5) and LLVM 3.8 (Centos7, Ubuntu 15.10 and Debian Stretch)

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 10:10:58 am
So !

I've mange to built the clanglib_wxGTK30-unix.cbp from tim_s.

But I have no .cbplugin out. I've no error when I built but this when I run :

Code

-------------- Build: use_pch in clanglib  wx3.0.x - Unix (compiler: GNU GCC Compiler)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).


-------------- Run: use_pch in clanglib  wx3.0.x - Unix (compiler: GNU GCC Compiler)---------------

Checking for existence: /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/devel30/libclanglib.so
Executing: ./codeblocks --debug-log --multiple-instance -ns -ni -v -p debug (in /home/astrapi/.lib/codeBlocks/ClangLib-build-tim_s/.)
Process terminated with status 255 (0 minute(s), 0 second(s))

But maybe it's useless because my codeblocks using wx2.8 ?

I've even sucessfully build the clanglib (unix).cbp from Clang-lib master ! (thanks to all your information) but I've
nothing happening after... I miss something... (in release I have my liblcanglib.so but no .cbplugin)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 21, 2016, 11:12:06 am
There is no .cbplugin file created as part of this build process.
You'll have to install the plugin manually by copying the libclanglib.so to

$CODEBLOCKSDIR/lib/codeblocks/plugins

and also the zipfile to
$CODEBLOCKSDIR/share/codeblocks

$CODEBLOCKSDIR is probably /usr/local for you, or wherever you've installed codeblocks.

BEWARE: I would be very much surprised that the plugin will work if you've compiled it with wxGTK3.0 and if codeblocks is compiled with wxGTK2.8

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 12:35:23 pm
Okayyyyyyyy (how can I know that ?)

And it works !!!!!!!!!!! You are all so great !!!!  ;D ;D ;D ;D ;D

Thanks everybody !

I learn lot of things  :D
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 06:30:36 pm
I've juste some little problem, I've tried and successfully build :
https://github.com/yvesdm3000/ClangLib (https://github.com/yvesdm3000/ClangLib)
https://github.com/alpha0010/ClangLib/tree/threads (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 ?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 21, 2016, 08:27:11 pm
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
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 09:09:59 pm
I've download the staging brank there : https://github.com/yvesdm3000/ClangLib/tree/staging (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)) ===|



(Thanks to help !)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 21, 2016, 11:08:43 pm
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("&amp;");
@@ -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:
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 21, 2016, 11:38:22 pm
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 ?)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 21, 2016, 11:55:55 pm
Look at the build logs and you can see which wxWidgets is being used in the Compiler and Linking steps.

If you do NOT know how to understand the "build logs" then please give up or learn to understand them!

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 22, 2016, 12:19:04 am
The build log is the input where g++ is shown isn't it ?

Code
-------------- Build: ClangLib in clanglib (Unix) (compiler: GNU GCC Compiler)---------------

g++-5 /home/astrapi/.lib/codeBlocks -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/lib/llvm-3.6/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DBUILDING_PLUGIN -O3 -Wextra -Wall -std=c++0x -ansi /home/astrapi/.lib/codeBlocks -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/lib/llvm-3.6/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -Wall -std=c++11 -std=c++14 -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/include/codeblocks/wxscintilla/include -I. -c /home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp -o .objs/plugins/clanglib/clangproxy.o

If not I will pass my way and took off my hat no problem, and take a litte tour on openclassroom or something :)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 22, 2016, 01:42:02 am
It is one line of the build log; but, it shows many possible problems!
You are likely using a different C++ Compiler then was used to build Code::Blocks; on Windows this will fail to work; not sure on Linux.
I have no idea what GCC C++ version was used to build Code::Blocks on your OS. ( I just realized this might be my issue on Linux.)
You have both "-std=c++11" and "-std=c++14" in it.
I question this "-D__GXX_EXPERIMENTAL_CXX0X__"; it could be valid or it might not be valid.
You do appear to be using wxWidgets 2.8; from "-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8"

Tim S.

The build log is the input where g++ is shown isn't it ?

Code
-------------- Build: ClangLib in clanglib (Unix) (compiler: GNU GCC Compiler)---------------

g++-5 /home/astrapi/.lib/codeBlocks -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/lib/llvm-3.6/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DBUILDING_PLUGIN -O3 -Wextra -Wall -std=c++0x -ansi /home/astrapi/.lib/codeBlocks -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/lib/llvm-3.6/include -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -pthread -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -Wall -std=c++11 -std=c++14 -D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/codeblocks -I/usr/include/codeblocks/wxscintilla/include -I. -c /home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp -o .objs/plugins/clanglib/clangproxy.o

If not I will pass my way and took off my hat no problem, and take a litte tour on openclassroom or something :)
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 22, 2016, 10:59:27 am
I install codeblocks from ppa:damien-moore/codeblocks-stable (http://ppa:damien-moore/codeblocks-stable) with apt-get, apt-get use g++
and I use in my program g++-5 (I should make a symbolic link to g++-5 to g++ maybe if it can make problem
to use different compiler).
I thought that it was normal to have -std=c++11 AND -std=c++14, so -std=c++14 is enough.
For "-D__GXX_EXPERIMENTAL_CXX0X__" it's something I found on internet, it is suppose to tell at he precompiler
how understand shared_ptr in purpose to have completion for it (for what I understand)
In your project I've replace "wx-config --libs/--cflags" by "wx-config --version=2.8 --libs/--cflags" for built it with the
same wxWidgets than my codeblocks but maybe if you are builting it for codeblocks with wxWidgets3.0 there are
some functions or differences that make some errors...

I don't know what I have to do, do I continue to try to built Yves or Tim S libclang ? (I'm sorry all this is new for me :compling myself, so I understand little step by little step)

I've tried to built https://github.com/yvesdm3000/ClangLib/tree/staging (https://github.com/yvesdm3000/ClangLib/tree/staging) plugin without c++14 (I think it just need c++11) without g++-5 but g++, and without
-D__GXX_EXPREIMENTAL_CXX0X__ but I come the same errors :

Code
||=== Build: ClangLib in clanglib (Unix) (compiler: GNU GCC Compiler) ===|
||warning: /home/astrapi/Bureau: linker input file unused because linking not done| /// Because of my local variable the thing that I don't undersant what is for
/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&)’|
/home/astrapi/.lib/codeBlocks/ClangLib-staging/clangproxy.cpp|1762|note: candidate is:|
/usr/include/c++/4.8/bits/stl_pair.h|276|note: 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++/4.8/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: 2 error(s), 10 warning(s) (0 minute(s), 32 second(s)) ===|

Questions :
1) I've seen this include in your project : ../codeblocks-1510/src/include
 and this one : ../codeblocks_src/src/include.
Me I just put /usr/include/codeblocks/ AND /usr/include/codeblocks/wxscintilla/include (because I don't understand
what else to put)
Did I again miss something ?
2) $(#CB_RELEASE_TYPE) is the global variable, I've see that it's in setting global variables cb-release-type that I
configure it, but I've always this linking undone.
What do I have to put in base ?
In include ? (/usr/include/codeblocks no ?)
In lib ? the place where is libcodeblocks.so no ?
3) maybe it will be easier if I built codeblocks (with wxWidgets3.0) myself with the same version as you've got ? (now I understand a bit more compilng stuff) ?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 22, 2016, 05:47:22 pm
I would suggest self building Code::Blocks using wxWidgets 2.8 version already on your computer.
I would NOT install it; in other words skip the step "make install".
I will try to self build wxWidgets 2.8 and Code::Blocks; since I have failed to get the Plugin to work with wxWidgets 3.0 (It causes runtime crashes on CB startup.)
This will eliminate wxWidgets 3.0 as a possible cause.

3) maybe it will be easier if I built codeblocks (with wxWidgets3.0) myself with the same version as you've got ? (now I understand a bit more compilng stuff) ?
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 22, 2016, 06:05:40 pm
Ok so I find the last version of codeblocks  using wxWidgets 2.8 I built it but not install it , and wait for further
instructions.

Thanks guys !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 22, 2016, 07:16:04 pm
I just realized that you can use Code::Blocks to build Code::Blocks instead of the normal configure/make method.

Tim S.

Ok so I find the last version of codeblocks  using wxWidgets 2.8 I built it but not install it , and wait for further
instructions.

Thanks guys !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 22, 2016, 09:19:15 pm
Cool that what I tought but what version did I take ?
source code or source code from svn ?
http://www.codeblocks.org/downloads/25 (http://www.codeblocks.org/downloads/25)   http://www.codeblocks.org/downloads/7 (http://www.codeblocks.org/downloads/7) ?
     (I suppose source code normal)

codeblocks-16.01-1.el7.src.rpm or codeblocks_16.01.tar.gz ?
     (I suppose .tar.gz )

In what it will be useful ? Isn't the same codeblocks than mine ?

(Don't answere the suppose if they are right (save ink) )
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 22, 2016, 11:22:06 pm
If you want to fix bugs and/or add features I would use SVN or Git to checkout a repo.
If you know neither Git or SVN, I would suggest SVN aka subversion.
If you have no plans to fix bugs or add features to Code::Blocks, I will see that download is best and add it to this post by editing.

This file looks best codeblocks_16.01.tar.gz if you have no plans to fix bugs or add features.
I used to use this URL to get version control repos. http://wiki.codeblocks.org/index.php/Developer_documentation (http://wiki.codeblocks.org/index.php/Developer_documentation)
But, I would suggest using my Git repo if you wish to use Git. I have too much trouble using the CB Devs git repos.
But, I am a Windows Git user and I think the CB Dev Team are non-windows people.
https://github.com/stahta01/codeblocks_svn2git_https_metadata.git (https://github.com/stahta01/codeblocks_svn2git_https_metadata.git)
Do NOT try to push to this repo; for two reasons.
1. I only copy stuff to this repo from CB SVN repo.
2. I have no idea how to handle pull request, because I have no write permissions to the CB SVN repo.

NOTE: You need to follow these steps to get "git svn info" to work after doing an git clone. https://github.com/stahta01/cb_misc/blob/master/Notes/Fix%20Git%20SVN%20information%20steps.txt (https://github.com/stahta01/cb_misc/blob/master/Notes/Fix%20Git%20SVN%20information%20steps.txt)
Edit: I have used these steps under Debian Linux without any issues.

Tim S.

Cool that what I tought but what version did I take ?
source code or source code from svn ?
http://www.codeblocks.org/downloads/25 (http://www.codeblocks.org/downloads/25)   http://www.codeblocks.org/downloads/7 (http://www.codeblocks.org/downloads/7) ?
     (I suppose source code normal)

codeblocks-16.01-1.el7.src.rpm or codeblocks_16.01.tar.gz ?
     (I suppose .tar.gz )

In what it will be useful ? Isn't the same codeblocks than mine ?

(Don't answere the suppose if they are right (save ink) )
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 22, 2016, 11:56:43 pm
Thanks ! I will I think get the codeblocks_16.01.tar.gz, because I don't know how contribute for codeblocks... (Haven't got the skills anyway for now.) And it looks easier too.

I up for new arrival or new features for ClangLib, thank you again (I say a lot thank you but it's really nice to take time for other people indeed )

Pierre

Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 23, 2016, 04:06:48 am
@yvesdm3000: I think I am ready to start editing the clanglib-unix.cbp file and testing, then maybe it will be ready for git pull request.
But, I have some questions.

Is this project supposed to be for a Code::Blocks installed configuration or for a Self-Built Code::Blocks that is NOT installed?
In other words, do these commands work "pkg-config --libs codeblocks" and "pkg-config --cflags codeblocks".
If they work, then Code::Blocks is likely installed.
If they do NOT work then likely Self-Built Code::Blocks that is NOT installed.

Tim S.




Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 23, 2016, 06:32:04 am
Is this project supposed to be for a Code::Blocks installed configuration or for a Self-Built Code::Blocks that is NOT installed?
In other words, do these commands work "pkg-config --libs codeblocks" and "pkg-config --cflags codeblocks".
If they work, then Code::Blocks is likely installed.
If they do NOT work then likely Self-Built Code::Blocks that is NOT installed.

Tim S.
If Code::Blocks is installed, the pkg-config should work. I however would assume that if Code::Blocks is installed in an alternative location (like in all of my cases, I need to work in environments where I don't have root access nor codeblocks preinstalled), one should really use PKG_CONFIG_PATH to point to a location where the codeblocks.pkg file is found. Using an uninstalled Code::Blocks would cause many problems imho.

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 23, 2016, 08:19:20 am
I created the pull request.

Try the project and verify it works for you.
The target no_pch does NOT work because the code has PCH related issues.
I will verify my patch to fix that is correct in the next few days.

PCH stands for Precompiled Header for Code::Blocks that normally means "sdk.h".

I added some before build steps to display the output of the commands "pkg-config --libs codeblocks" and "pkg-config --cflags codeblocks".
FYI: If you use the EnvVars plugin to set PKG_CONFIG_PATH you will likely have to exist out of Code::Blocks to see the setting take effect.

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 23, 2016, 10:09:31 am
I accepted the pull request. Thanks !
It builds for me on Centos7 x64 and my own compiled wx 2.8.

Any reason why you've replaced the release and debug build with PCH and NO_PCH? I intended to use the 'Release' one with optimizations enabled and the 'Debug' one without optimizations but with debugging symbols (and assertions at a later stage). I could imagine to use pch for release and no_pch for the debug build, but the naming would then indicate a detail instead of the intention...

I'm OK with removing the 'lib' in front since it's not needed. Initially I had problems where C::B did'nt want to accept the plugin so one starts doing every detail exactly the same as an example plugin until you find what's wrong. I don't actually know why all other plugins have 'lib' in front of them on Linux ?

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 23, 2016, 10:53:33 am
I created the pull request.

Try the project and verify it works for you. For Yves I suppose
The target no_pch does NOT work because the code has PCH related issues.
I will verify my patch to fix that is correct in the next few days.

PCH stands for Precompiled Header for Code::Blocks that normally means "sdk.h". Thanks !

I added some before build steps to display the output of the commands "pkg-config --libs codeblocks" and "pkg-config --cflags codeblocks".
FYI: If you use the EnvVars plugin to set PKG_CONFIG_PATH you will likely have to exist out of Code::Blocks to see the setting take effect.

Tim S.

I've successfully built it (Youhouu !!) I juste have to make some changes :
translationunit.h:54         assert( first.m_id == second.m_Id );  //I change the m_id in m_Id
I change in linker settings wx-config --libs in wx-config --version=2.8 --libs
And (like you said), compiling with g++-5 and -std=c++14 didn't work so I take it off too.
And it compile I had my .zip .so and .cbplugin, if I installed it from cbplugin or install it manually, it get me the same as before, impossible to remember what I tick (like parse documentation) (maybe it's because it's in a folder where it must be root ? but the other plugin has the same .zip ant it works so...), and if I disable the code completion plugin, I didn't see anymore the reparse project option.
If I open a other project, the completion will not work on it (sometimes...), but if I open it alone, it will... (the clang lib tool bar is grey)
It doesn't complete function argument... Rhalala ! (it seems to be a complicated stuff this things...)


But it works for completion, it complete auto and shared_ptr , and there is no bug with chowing sometimes the pop
up documentation and sometime not. I don't see the documentation of lib that I use (SFGUI or SFML) but I see the documentation that I made.

I've compile but not install codeblocks releaser 16.01 with wx2.8, I juste have this error link with the global variable cb_release_type (I've not understand this thing)
||warning: /home/astrapi/.lib/codeBlocks/codeblocks-16.01.release/src/base: linker input file unused because linking not done|, but It's built if it can be use for something...

Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 23, 2016, 02:56:49 pm
I've successfully built it (Youhouu !!) I juste have to make some changes :
translationunit.h:54         assert( first.m_id == second.m_Id );  //I change the m_id in m_Id
That's fixed in a later commit.

Quote
impossible to remember what I tick (like parse documentation)

I think the 'parse documentation' tab is not implemented yet. I copied some dialog items from the regular code-completion plugin that I think we'll also need in the end.

Documentation is currently always parsed. When you don't get documentation during code-completion, then this is because there is a timing issue that I'm aware of.
Don't expect the documentation to be feature-complete, it is not.

Regarding documentation, in the 'advanced'-tab there is now the option to use all comments as documentation and not only DoxyGen-type. That option should really be moved to the 'documentation' tag, but it's allready there ready for use.

The diagnostics-tab should all be implemented, and some '-W' options in the latest should also work, as is the 'advanced' tab.

Yves
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 23, 2016, 04:05:01 pm
Oops, I forgot to make an CB project change that is needed.

I change in linker settings wx-config --libs in wx-config --version=2.8 --libs

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: astrapi on March 23, 2016, 04:09:17 pm
Cool cool cool !
I watch yours gits, and I'm ready to program !
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: stahta01 on March 24, 2016, 05:29:15 pm
I missed this post by you; I am going to answer it inline.

I accepted the pull request. Thanks !
It builds for me on Centos7 x64 and my own compiled wx 2.8.

Any reason why you've replaced the release and debug build with PCH and NO_PCH? I intended to use the 'Release' one with optimizations enabled and the 'Debug' one without optimizations but with debugging symbols (and assertions at a later stage). I could imagine to use pch for release and no_pch for the debug build, but the naming would then indicate a detail instead of the intention...
I did NOT realize you plan to use the 'Debug' and 'Release' targets; I can change them back if you want. I would prefer to use lower case target names when doing that.
I will work on that before doing my next pull request.
Edited named the targets 'debug' and 'release'. in the pull request I just did.
Did I do the pull request correctly?

I'm OK with removing the 'lib' in front since it's not needed. Initially I had problems where C::B did'nt want to accept the plugin so one starts doing every detail exactly the same as an example plugin until you find what's wrong. I don't actually know why all other plugins have 'lib' in front of them on Linux ?

Yves
I removed the lib because the zipped cbplugin file does NOT like the lib prefix; this is a bug in the CB Wizard that I might try to fix in the future.

Tim S.
Title: Re: Unable to compile ClangCompletion cbplugin
Post by: yvesdm3000 on March 25, 2016, 04:06:55 pm
I did NOT realize you plan to use the 'Debug' and 'Release' targets; I can change them back if you want. I would prefer to use lower case target names when doing that.
I will work on that before doing my next pull request.
Edited named the targets 'debug' and 'release'. in the pull request I just did.
Did I do the pull request correctly?
Yes no problem for me

Yves