Author Topic: Adding CppCheck, Ubuntu 18.04, installed via .deb  (Read 317 times)

Offline jlmoriart

  • Single posting newcomer
  • *
  • Posts: 4
Adding CppCheck, Ubuntu 18.04, installed via .deb
« on: May 09, 2020, 01:49:38 am »
Hi all, I'm wondering where I can find the .cbplugin file for the CppCheck CodeBlocks plugin. (That's what it's looking for when you click "install new" in the plugins settings.)

This wiki page just links to the CppCheck website, where it lists CodeBlocks as "integrated":

http://wiki.codeblocks.org/index.php/CppCheck_plugin

I do see "contrib" labeled .deb files in the download folder, but installing them doesn't seem to have any effect. I don't see CppCheck in the plugins manager, or in Settings->Environment. (You can apparently also get the contrib stuff after the fact via the codeblocks-contrib package, but of course a dependency of that package is the codeblocks package, and I installed via the .deb files. I had issues installing the codeblock package via apt forever ago.)

Is there an obvious source I missed for the .cbplugin? If not, any idea why the .deb files don't seem to be doing their thing? Is it really worth diving back into getting it to work via apt to try that method?

I also have the source folder, and I see that there's a CppCheck folder in src/plugins/contrib. Am I supposed to build CppCheck myself? If so, are any instructions available for noobs? Iím relatively new to C++, and so still donít really know what Iím looking at when I open a folder like that.

Thanks very much for any help!

(I do have installed CppCheck via apt, so that should be available to the plugin... I assume?)
« Last Edit: May 09, 2020, 02:01:27 am by jlmoriart »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #1 on: May 09, 2020, 03:10:59 am »
cppcheck plugin is in the contrib package. You should have a file like /usr/lib/codeblocks/plugins/libCppCheck.so in your file system.
(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 jlmoriart

  • Single posting newcomer
  • *
  • Posts: 4
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #2 on: May 09, 2020, 03:47:12 am »
Thanks very much for the reply. I only have the 13 .so files in that folder that correspond to the plugins I can already see in CodeBlocks.

Is it relevant that when I open the codeblcoks-contrib_20_03_amd_64.deb file in the Software manager and click install, it goes through the install bars, and then instead of changing to red and changing the text, it goes right back to "Install", which I can click and go through the process again. Does this mean that the install is failing?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #3 on: May 09, 2020, 07:25:14 am »
Probably, I don't use UI installers. Probably doing apt install codeblocks-contrib in a terminal would tell you what is the error.
(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 jlmoriart

  • Single posting newcomer
  • *
  • Posts: 4
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #4 on: May 11, 2020, 03:44:11 am »
I actually was trying to install from the command line via apt, but I didn't read the dependency info close enough. It says:

Code: [Select]
The following packages have unmet dependencies:
 codeblocks-contrib : Depends: codeblocks (= 16.01+dfsg-2.1) but 20.03 is to be installed
                      Depends: libwxsmithlib0 (= 16.01+dfsg-2.1) but 20.03 is to be installed

So... the version of codeblocks I have is too new for the version that's currently available via the default repository? Is there maybe a more up to date ppa?

(It also didn't occur to me that installing via .deb would have the same end result as installing via apt. I figured that they would be unaware of each other, but some googling reveals that that's not the case.)

Installing the contrib-related .deb files (that would, I assume, be the correct, newest version) from the command line with dpkg seems to gives me dependency issues:

Code: [Select]
Setting up codeblocks-common (20.03) ...
dpkg: dependency problems prevent configuration of codeblocks-contrib:
 codeblocks-contrib depends on libboost-system1.67.0; however:
  Package libboost-system1.67.0 is not installed.
 codeblocks-contrib depends on libhunspell-1.7-0; however:
  Package libhunspell-1.7-0 is not installed.

dpkg: error processing package codeblocks-contrib (--install):
 dependency problems - leaving unconfigured
Setting up codeblocks-contrib-common (20.03) ...
dpkg: dependency problems prevent configuration of codeblocks-contrib-dbg:
 codeblocks-contrib-dbg depends on codeblocks-contrib (= 20.03); however:
  Package codeblocks-contrib is not configured yet.

Any idea if there's a single package where I can get those things? I tried googling one (hunspell), and found what seemed like a legit download page... but even then I have no idea what to do with the folder I was given, maybe because I got the wrong thing, or maybe just because I'm a noob.

Thanks very much for any help!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #5 on: May 11, 2020, 10:31:05 am »
On our download page, with provided a link to a PPA which has the packages for the 20.03 release. Just use the PPA, it is easier and a lot less error prone.
(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 jlmoriart

  • Single posting newcomer
  • *
  • Posts: 4
Re: Adding CppCheck, Ubuntu 18.04, installed via .deb
« Reply #6 on: May 11, 2020, 11:41:20 pm »
I've added the ppa and installed from there, looks like I've got all the contrib functionality. Thanks very much for your help!

I'd love to tip you some Bitcoin Cash (ticker symbol BCH) for your help, if you're interested, so feel free to send me an address. (Also feel free to send me a dm if you're not sure how to get set up.)

Thanks and cheers!