Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to compile a basic C++ app consisting of the following code:

#include <unity/unity/unity.h>

int main()
{
    return 0;
}

just to try and get the libunity library compiled before I start doing any work on the app. I'm using QMake to manage the makefile, which is as follows:

######################################################################
# Automatically generated by qmake (2.01a) Mon Jan 2 16:33:26 2012
######################################################################

TEMPLATE = app 
TARGET = unity-lens-test

CONFIG -= qt

unix {
  CONFIG += link_pkgconfig
  PKGCONFIG += glib-2.0 
  PKGCONFIG += dee-1.0
  PKGCONFIG += libdbusmenu-0.4
}

LIBS += -lunity \
         += -lgtest

DEPENDPATH   += . src 

INCLUDEPATH  += .

# Input
SOURCES += src/main.cpp

My problem lies with the third PKGCONFIG directive within the unix{} block, referring to libdbusmenu-0.4. When I try to run qmake on this file, I get the following error:

Package libdbusmenu-0.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdbusmenu-0.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdbusmenu-0.4' found
Package libdbusmenu-0.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdbusmenu-0.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdbusmenu-0.4' found
Package libdbusmenu-0.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdbusmenu-0.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdbusmenu-0.4' found

which is an error I never got when I added the entries for glib-2,0 or dee-1.0. When I try to compile without this option, the qmake command succeeds but GCC returns the following error:

/usr/include/unity/unity/unity.h:15:37: fatal error: libdbusmenu-glib/client.h: No such file or directory

When I search for this file, I find it in

/usr/include/libdbusmenu-0.4/libdbusmenu-glib/client.h

in which case I would expect PKGCONFIG += libdbusmenu-0.4 to fix the issue, at least going by my experience with the previous two options.

I have all the libunity build dependencies installed so I'm not sure what else I could possibly have to do to get this to compile. Is there something special about libdbusmenu that requires a different approach? Is the problem at my end? I've checked out the Rocking out with libunity notes but there's nothing in there regarding compilation.

Thanks in advance for your help.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

You're looking for the wrong package config file. It should be dbusmenu-glib-0.4.

share|improve this answer
    
Thanks a lot :) –  Chris Wilson Jan 2 '12 at 20:43
add comment

install the following packages:

sudo apt-get install libdbusmenu-glib-dev
sudo apt-get install libunity-dev
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.