Saturday, May 4, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 861  / 3 Years ago, sun, june 20, 2021, 1:45:46

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.


More From » application-development

 Answers
6

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


[#41171] Monday, June 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gigglcept

Total Points: 113
Total Questions: 105
Total Answers: 125

Location: Christmas Island
Member since Wed, Jan 13, 2021
3 Years ago
;