Author Topic: Unable to compile ClangCompletion cbplugin  (Read 23791 times)

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #15 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...)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unable to compile ClangCompletion cbplugin
« Reply #16 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #17 on: March 20, 2016, 03:34:51 pm »
Ok I'll try this in a moment ! Thanks everybody !

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #18 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 ?

« Last Edit: March 20, 2016, 06:04:20 pm by astrapi »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unable to compile ClangCompletion cbplugin
« Reply #19 on: March 20, 2016, 06:16:08 pm »
It seems that you have two different versions of clang/llvm.
Is this the case?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #20 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... ( :-[ )
« Last Edit: March 20, 2016, 07:08:59 pm by astrapi »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unable to compile ClangCompletion cbplugin
« Reply #21 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!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #22 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 ?
« Last Edit: March 20, 2016, 07:20:05 pm by astrapi »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unable to compile ClangCompletion cbplugin
« Reply #23 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #24 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
« Last Edit: March 20, 2016, 09:55:00 pm by astrapi »

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #25 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 !

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Unable to compile ClangCompletion cbplugin
« Reply #26 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
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #27 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)
« Last Edit: March 21, 2016, 10:31:46 am by astrapi »

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Unable to compile ClangCompletion cbplugin
« Reply #28 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
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline astrapi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Unable to compile ClangCompletion cbplugin
« Reply #29 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