News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

wxSmith and Valgrind Pluggin Installation

Started by spflanze, February 08, 2019, 06:46:08 AM

Previous topic - Next topic

spflanze

I installed Code::Blocks from svn 11562 and wxWidgets version 3.0.3 from source according to the instructions at http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux
In Code::Blocks Help => About I see verification that wxWidgets is installed.

After installing Code::Blocks I installed Valgrind and wxSmith with the commands:
sudo apt-get install codeblocks-contrib
sudo apt-get install valgrind


I do not see Valgrind in the Code::Blocks's menu bar. And when I attempt to create a wxWidgets frame based  project with wxSmith Preferred GUI Builder I get the error message
QuotewxSmith is not loaded, can not continue

Why would Code::Blocks not recognize that codeblocks-contrib and valgrind are installed?

Miguel Gimenez

If you install C::B from source you must use the plugins you compiled, not the repository ones. For the contrib plugins to be compiled you must specify --with-contrib-plugins=all when calling configure.

Valgrind is needed to execute the Valgrind plugin, but it is not the plugin itself.

spflanze

When I executed the command:
./configure --with-contrib-plugins=all
I got the error:
Quotechecking for HUNSPELL... no
configure: error: Package requirements (hunspell) were not met:

No package 'hunspell' found
I do have a repository installation of hunspell. Now I will have to compile hunspell. How is this done in a way that configure will find it? Would it be sufficient to compile it in a subdirectory of the same ~/devel directory I compiled wxWidgets and Code::Blocks in? (wxWidgets and Code::Blocks were each compiled their own subdirectories of ~/devel).

I attempted to ignore this error regarding hunspell and continued to compile with the make command. I got this warning and error:
Quoteconfigmanager-revision.cpp:15:25: warning: ../../src/include/sdk_precomp.h.gch: not used because `WXUSINGDLL' not defined [-Winvalid-pch]
#include "sdk_precomp.h"
                         ^
In file included from ../../src/include/sdk_precomp.h:13:0,
                 from configmanager-revision.cpp:15:
../../src/include/sdk_common.h:37:10: fatal error: wx/wxprec.h: No such file or directory
#include <wx/wxprec.h>
          ^~~~~~~~~~~~~
compilation terminated.

The file wxprec.h does exist in the path:
/opt/wx/3.0/include/wx-3.0/wx/wxprec.h
How can I get make to find it there?

sodev

configure failed, your source tree is in an undefined state, everything can happen from finding the Holy Grail to starting World War 3, but very unlikely make will do anything useful.

To compile against your system packages you always need to install their dev packages, nothing installs these automatically, you always have to do it yourself.

I never had to compile anything extra for CodeBlocks except wxWidgets. The configure script also has a help switch, its output especially lists the available plugins, if you dont want them all, you can specify only the ones you need.

I usually compile CodeBlocks like this (the excluded plugin requires boost that i dont want to install system wide to prevent problems with my various private ones):

./configure --with-contrib-plugins=all,-NassiShneiderman

spflanze

I executed these commands:
sudo apt-get install libgamin-dev
sudo apt-get install libhunspell-dev

after which the command:
./configure --with-contrib-plugins=all
completed without error. Thanks :)
However when I attempted to compile with the make command I still got the "wx/wxprec.h: No such file or directory" error. I tried again after executing:
./configure --with-contrib-plugins=all,-NassiShneiderman
and got the same result.



Miguel Gimenez

Do you have libwxgtk3.0-dev installed? Try

sudo apt-get install libwxgtk3.0-dev

spflanze

#6
libwxgtk3.0-dev was not installed. So I installed it, but it made no difference  The compiler still cannot find  wx/wxprec.h.

The libwxgtk3.0-dev installed version is (3.0.4+dfsg-3). But it is wxWdigets 3.0.3 I have installed. Could that by why I still get this error?

stahta01

What Linux distro are you using?
What does the next two commands return?


wx-config --libs



wx-config --cflags


Tim S.


C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze

Ubuntu 18.04

~/devel/trunk$ wx-config --libs

-L/usr/local/lib -pthread   /usr/local/lib/libwx_gtk2u_xrc-3.0.a /usr/local/lib/libwx_gtk2u_qa-3.0.a /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_gtk2u_html-3.0.a /usr/local/lib/libwx_gtk2u_adv-3.0.a /usr/local/lib/libwx_gtk2u_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lgthread-2.0 -pthread -lX11 -lXxf86vm -lSM -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lpng -lexpat -lwxregexu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lz -ldl -lm

~/devel/trunk$ wx-config --cflags

-I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread


stahta01

#9
Code::Blocks does not work very well with static wxWidgets.

Edit: I thought you were using the system wxWidgets instead of a local built version?

Edit2: Post output of this command
wx-config --list

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze


spflanze

It is a local built version.

~/devel/trunk$ wx-config --list

    Default config is gtk2-unicode-static-3.0

  Default config will be used for output

  Alternate matches:
    gtk3-unicode-static-3.0

stahta01

If you wish to use a local built version of wxWidgets you need to build the shared version instead of the static version.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze

I thought it was the shared version until now. I followed the instructions at:
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux
to install wxWidgets. The source file was expanded from wxWidgets-3.0.3.tar.bz2

This is the essential command sequence I used on source files expanded from that:

../configure --prefix=/opt/wx/3.0 \
       --enable-xrc \
       --enable-monolithic \
       --enable-unicode
make
sudo make install


What need I do different to make it shared?

stahta01

I forget.

It is likely either "--enable-shared" or "--disable-static".

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]