libglibmm-2.4-dev Not Installed Correctly

Asked by tomdean

Ubuntu 16.04
I installed libxml++2.6-dev. The examples need libglibmm to build.

in the myparser example,

> gcc main.cc myparser.cc -I. -I/usr/include/libxml++-2.6/ -o myparser
In file included from /usr/include/libxml++-2.6/libxml++/exceptions/internal_error.h:25:0,
                 from /usr/include/libxml++-2.6/libxml++/libxml++.h:50,
                 from myparser.h:25,
                 from main.cc:31:
/usr/include/libxml++-2.6/libxml++/exceptions/exception.h:24:28: fatal error: glibmm/ustring.h: No such file or directory
compilation terminated.
In file included from /usr/include/libxml++-2.6/libxml++/exceptions/internal_error.h:25:0,
                 from /usr/include/libxml++-2.6/libxml++/libxml++.h:50,
                 from myparser.h:25,
                 from myparser.cc:22:
/usr/include/libxml++-2.6/libxml++/exceptions/exception.h:24:28: fatal error: glibmm/ustring.h: No such file or directory
compilation terminated.

> sudo apt-get install libglibmm-2.4-dev
libglibmm-2.4-dev is already the newest version (2.46.3-1).
...

> locate libglibmm
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1.3.0
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1.3.0
/usr/share/doc/libglibmm-2.4-1v5
/usr/share/doc/libglibmm-2.4-1v5/AUTHORS
/usr/share/doc/libglibmm-2.4-1v5/NEWS.gz
/usr/share/doc/libglibmm-2.4-1v5/README
/usr/share/doc/libglibmm-2.4-1v5/changelog.Debian.gz
/usr/share/doc/libglibmm-2.4-1v5/copyright
/var/lib/dpkg/info/libglibmm-2.4-1v5:amd64.list
/var/lib/dpkg/info/libglibmm-2.4-1v5:amd64.md5sums
/var/lib/dpkg/info/libglibmm-2.4-1v5:amd64.shlibs
/var/lib/dpkg/info/libglibmm-2.4-1v5:amd64.triggers

But, there is no include directory that should contain the *.h files.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Verify whether the header file exists in the include directory, e.g. with the command
locate ustring.h

If it does not exist in
/usr/include/glibmm-2.4/glibmm/ustring.h
then you can try reinstalling the package with the command
sudo apt-get install --reinstall libglibmm-2.4-dev

If the header file exists, then you probably have to provide some additional compilation parameter (something like -Iglibmm-2.4)

Revision history for this message
tomdean (tomdean) said :
#2

On 04/28/17 12:27, Manfred Hampl wrote:
> Your question #630193 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/630193
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> Verify whether the header file exists in the include directory, e.g. with the command
> locate ustring.h
>
> If it does not exist in
> /usr/include/glibmm-2.4/glibmm/ustring.h
> then you can try reinstalling the package with the command
> sudo apt-get install --reinstall libglibmm-2.4-dev
>
> If the header file exists, then you probably have to provide some
> additional compilation parameter (something like -Iglibmm-2.4)
>

I reintalled libxml2++-dev, libglibmm-2.4-dev, and libglib2.0-dev then
used :

gcc main.cc myparser.cc -I. `pkg-config --cflags glib-2.0` \
    `pkg-config --cflags libxml++-2.6` -o myparser \
    `pkg-config --libs glib-2.0` \
    `pkg-config --libs libxml++-2.6` \
    `pkg-config --libs glibmm-2.4` \
    -lstdc++

Also,

 > locate ustring.h
/usr/include/x86_64-linux-gnu/unicode/ustring.h
 > sudo updatedb
 > locate ustring.h
/usr/include/glibmm-2.4/glibmm/ustring.h
/usr/include/x86_64-linux-gnu/unicode/ustring.h
/usr/share/doc/libglibmm-2.4-doc/referenc/html/classGlib_1_1ustring.html

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Does it now work as expected, or are there further error messages?

Maybe `pkg-config --cflags glibmm-2.4` has to be added to the gcc command line (similar to the lines for glib and libxml++)

Can you help with this problem?

Provide an answer of your own, or ask tomdean for more information if necessary.

To post a message you must log in.