dbus-1.0/dbus/dbus.h:29:10: fatal error: 'dbus/dbus-arch-deps.h' file not found - dbus

I am using dbus in my programme, but when i include
#include <dbus-1.0/dbus/dbus.h>
I am getting error :
dbus-1.0/dbus/dbus.h:29:10: fatal error: 'dbus/dbus-arch-deps.h' file not found
In the folder dbus there is no dbus-arch-deps.h file.
I can see this file in a folder lib64/dbus-1.0/include/dbus/dbus-arch-deps.h
Can any one please help me to compile this?
Or any suggestion, as I am stuck badly here.

Since I didnt get the answer from any one, but I finally solved the issue.
So would like to post the solution if some one faces similar problem.
I solved the problem, by adding -I/usr/lib64/dbus-1.0/include/ in cflags.

Late answer. However This may be helpful for somebody who's working on WSL (Windows sub system ) with ubuntu (18.04 lts).
The includ folders are
/usr/lib/x86_64-linux-gnu/dbus-1.0/include
/usr/include/dbus-1.0
Also Link with :
-ldbus-1
In case if you find nothing in there try : sudo apt-get install dbus-x11

The problem is that dbus needs two different include paths. In any case, the best approach is to use pkg-config here. The pkg-config file dbus-1.pc, in fact, includes these cflags:
Cflags: -I${includedir}/dbus-1.0 -I${libdir}/dbus-1.0/include
So, on Manjaro for instance, you'd get:
pkg-config --cflags dbus-1
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
On an arm debian you'd get:
pkg-config --cflags dbus-1
-I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include

As it's been answered here, if you're using CMake, just add
target_include_directories(ProjectName PRIVATE /usr/lib/x86_64-linux-gnu/dbus-1.0/include/ /usr/include/dbus-1.0/)
target_link_libraries(ProjectName PRIVATE dbus-1)
lines after the add_executable line, where ProjectName - is the name of your project

Try
sudo cp /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/dbus-arch-deps.h /usr/include/dbus-1.0/dbus/.

Related

During make mupdf, fatal error: X11/Xlib.h file not found in mac

I am installing muPDF.
I gave an input like make prefix=/usr/local install in terminal
I have installed XQuartz already
But I get an error as follows
In file included from thirdparty/glfw/src/context.c:28:
In file included from thirdparty/glfw/src/internal.h:85:
thirdparty/glfw/src/x11_platform.h:35:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^
make XCFLAGS=-I/opt/X11/include XLIBS=-L/opt/X11/lib
I'm on Mac OS X 10.9;
The makefile looks for X11 headers into /usr/local/include/X11 instead of /opt/X11/include/X11
The quick fix is a symlink
$ sudo ln -s /opt/X11/include/X11 /usr/local/include/X11
You may also need this further fix for OpenGL headers
$ sudo ln -s /opt/X11/include/GL /usr/local/include/GL
Probably exists a more elegant solution by specifying headers location when invoking make but I couldn't find a way to do that.
The best solution for now is to use the X11 mupdf (and disable the openGL one):
make HAVE_GLFW=no

#ifdef to findout if using debian or fedora/RH/centos

Is there a clean way to differentiate debian include path from RH/fedora/centos one?
I'd like to link with the wbxml2 library but unfortunately the include file si not in the same location depending of the distro.
on debian/ubuntu:
#include <wbxml.h>
and on others:
#include <wbxml2/wbxml.h>
Does anybody have a clean solution to make this code portable (using #ifdef for example) ?
Thanks
Looking at the list of provided files for the -dev package shows, among other things of course:
/usr/lib/pkgconfig/libwbxml2.pc
That line is a "package configuration" file for the development package. That means you don't need to care about the absolute location: use the package configuration tool instead.
Add this to your Makefile:
CFLAGS += $(pkg-config --cflags libwbxml2)
LDLIBS += $(pkg-config --libs libwbxml2)
And you will get the proper paths on all systems using pkg-config.
This is the proper, correct and expected way to deal with this issue, and the reason pkg-config exists in the first place.

Shared library creation in LINUX throws error

I've ten ".o" files in a directory.i want to combine them as a shared lib (.so) file.
For doing so,I am issuing following command
#gcc -shared *.o -o abc.so
but it throws following error message:
No command '-shared' found, did you mean:
Command 'gshared' from package 'gshare' (universe)
-shared: command not found
What could be the possible reason? Anything wrong with the command?
Any help ?
I agree with Chen Levy. It looks like gcc is either a stange version or not what you think it is. When I do:
gcc -shared *.o -o abc.so
I get the desired reponse. Try echo, or even:
which gcc
to try and see what's really going on. PS: I Tested on Ubuntu 10.10

How do I patch libxml2 so it will compile with ICU support when using a prefix?

I'm trying to fix a bug in libxml2. I cannot get it to compile with --with-icu when using --prefix=/Server/software. I have submitted a bug report here, but I need to get it to compile for resolving a conflict when compiling PHP with intl support. I suspect it's a problem with the Makefile. My experience with Makefile's is limited. The desired result is coming up with a patch that can be submitted to the linked bug report.
The --with-icu flag causes LIBXML_ICU_ENABLED to be defined. The included code is supposed to resolve a conflict when including headers from both icu and libxml2 (specifically, both use UChar). The PHP plugin intl, activated with --enable-intl, requires icu. libxml2 is needed by PHP for DOM/XML functions.
There are two problems.
First, this config:
./configure --prefix=/Server/software --enable-shared --enable-static --with-icu
Results in:
configure: error: libicu config program icu-config not found
This happens because of this code in configure.in:
WITH_ICU=0
if test "$with_icu" != "yes" ; then
echo Disabling ICU support
else
ICU_CONFIG=icu-config
if ${ICU_CONFIG} --cflags >/dev/null 2>&1
then
ICU_LIBS=`icu-config --ldflags`
LDFLAGS="$LDFLAGS $ICU_LIBS"
WITH_ICU=1
echo Enabling ICU support
else
AC_MSG_ERROR([libicu config program icu-config not found])
fi
fi
Specifically ICUCONFIG=icu-config isn't respecting --prefix=/Server/software. I can work around this by doing export PATH=/Server/software/bin:$PATH.
This "fixes" the ./configure problem.
Second, when I run make I get errors, the most relavent being:
./include/libxml/encoding.h:31:26: error: unicode/ucnv.h: No such file or
directory
The unicode/uncv.h file is in /Server/software/include/unicode/uncv.h. I suspect the compiler is looking for this file in the local directory and in my /usr directory.
This is what the error is referring to:
#ifdef LIBXML_ICU_ENABLED
#include <unicode/ucnv.h>
#endif
Clearly this is a path issue when using --with-icu and --prefix=/Server/software. Without --with-icu it compiles fine, but this is needed to resolve a define UChar conflict when compiling PHP with both icu and libxml2.
The result of icu-config --cflags is:
-O2 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long
This is being piped into /dev/null.
The result of icu-config --ldflags is:
-lpthread -lm -L/Server/software/lib -licui18n -licuuc -licudata -lpthread -lm
What needs to be changed to resolve these issues?
So, take a look at where it's using icu-config. It should be doing something like icu-config --cppflags which should set -I/Server/Software/include or similar. You could work around it by setting CPPFLAGS to include such a parameter yourself.
Can you include the actual compile command line immediately before the error?
Sounds like a bug in libxml - it ought to search ${PREFIX}/bin for icu-config.
Also, ICU now exports pkg-config files, which are more of a standard way to find such items.
Try this before WITH_ICU :
ICU_CPPFLAGS=`icu-config --cppflags`
CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS"
update I'm going to quote Luke's last response. Glad it's working.
I solved the linker problems, so now it all works. For this question
using libxml 2.7.7 was the solution. It seems OX X 10.6 ships with
2.7.8. So for it to work you have to compile libxml2 yourself with 2.7.7. The linker problems are solved by adding LIBS="-lresolv -lstdc++" just before PHP's ./configure. If installing to a non-standard location you also need to compile ICU with
--enable-rpath. I've accepted your answer. Feel free to update it with this information :). – Luke 17 hours ago

Cannot find -lcutil even though all the paths are correct

When compiling some CUDA code, I get the error, that the libcutil cannot be found even though I checked that the paths are correct.
Example
$ nvcc mycudacode.cu -lcutil -o mycudaproject -I ~/NVIDIA_GPU_Computing_SDK/C/common/inc -L ~/NVIDIA_GPU_Computing_SDK/C/lib
/usr/bin/ld: cannot find -lcutil
compilation terminated.
Even though:
$ ~/NVIDIA_GPU_Computing_SDK/C/lib$ ls
libcutil_x86_64.a libparamgl_x86_64.a librendercheckgl_x86_64.a
I have tried the following:
cp $(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/libcutil_x86_64.a /usr/local/cuda/lib/libcutil.a
and it works.
From the NVIDIA Forums:
On linux 64bit one has to rename libcutil_x86_64.a into libcutil.a.
So cd into the folder $(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/ (or where you installed CUDA) and enter: cp libcutil_x86_64.a libcutil.a
DISCLAIMER
As I already stumbled over this problem twice I added the question and the answer as a form of documentation.

Resources