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

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

Related

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

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/.

MOTIF compiling error / X11/intrinsic.h missing

i have MOTIF installed X11
a easy program is saved as hello.c
there is the following message
where can i get the X11/intrinsic.h , file ???
need help to compile
my system : MX-16 Linux Debian Jessie / i386
Code:
hans#mx1:~/Documents
$ cc push.c -o push -lXm -lXt -lX11
In file included from push.c:2:0:
/usr/include/Xm/Xm.h:59:27: fatal error: X11/Intrinsic.h: No such file or directory
#include <X11/Intrinsic.h>
^
compilation terminated.
hans#mx1:~/Documents
I installed the libxt-dev package on my Debian box:
apt-get install libxt-dev
Then the proper header will be installed:
# find /usr -name "Intrinsic.h" -print
/usr/include/X11/Intrinsic.h
Been using xv for several decades now -- I always find myself trying to rebuild it.
The copy on my system came from libxt-dev
$ locate Intrinsic
/usr/include/X11/Intrinsic.h
/usr/include/X11/IntrinsicI.h
/usr/include/X11/IntrinsicP.h
$ dpkg-query -S /usr/include/X11/Intrinsic.h
libxt-dev:amd64: /usr/include/X11/Intrinsic.h
You may want to install and use apt-file - you can ask it for a filename and it will tell you which packages (that you don't even have to have installed - just from the repos in your sources.lists) contain a file with that name

SysGCC toolchain can't find files in sysroot

I set up this toolchain on my Windows machine for my Pi (raspberry-gcc4.6.3-nosysroot.exe) and then I followed the instructions here to synchronize my sysroot.
I use a library called WiringPi in my project, and I have confirmed that it is in the synchronized sysroot:
Then I attempt to compile it:
arm-linux-gnueabihf-gcc -Wall -O -c main.c
But I get the following error:
fatal error: wiringPi.h: No such file or directory
What do I have to do to make the compiler find the header file? I thought the whole point of synchronizing the sysroot was to make this kind of thing work?
You'll have to let gcc know where to look for the include files via the -I argument. In the case above, -IC:\SysGCC\Raspberry\...\usr\local. You may have to add more than one include path, depending on where the required files are scattered. You can also try to set gcc's environment variable(s).
Finding out the correct include path can be a little tedious (see above: should it be local\ or local\include\?). Maybe you can find the environment setting for all default include paths on your Pi and just copy it over to your Windows machine.
Edit: Think I got it: echo | gcc -v -E -

C Compile Fatal Error 'file not found' from ImageMagick Install Mac OS

I am trying to compile a C program that requires Image Magick's MagickWand.h:
#include "wand/MagickWand.h"
But my Image Magick was installed through Homebrew on my Mac so I changed the include to the actual location:
#include </usr/local/Cellar/imagemagick/6.8.9-7/include/ImageMagick-6/wand/MagickWand.h>
However, when I compiled the program I received the following error:
/usr/local/Cellar/imagemagick/6.8.9-7/include/ImageMagick-6/wand/MagickWand.h:71:10: fatal error: 'wand/method-attribute.h' file not found
#include "wand/method-attribute.h"
Now I've been going into the .h files when this error crops up and changing their #includes so that they are pointed correctly (because that appears to be the problem), but there is always a new error here and I'd rather not spend hours manually updating these because of a Homebrew install. Does anyone have any suggestions on how to fix this without manually updating each file? I'm not sure exactly what the problem is so perhaps there is a more elegant solution.
Your code should include the MagickWand library as system headers, and keep the generic path. This will keep your future compiling from breaking when the system/library updates.
#include <wand/MagickWand.h>
Tell your C compiler where homebrew installed ImageMagick by setting the preprocessor include flag -I, and linking/library options with the -L & -l flags.
example:
clang -I/usr/local/Cellar/imagemagick/6.8.9-7/include/ImageMagick-6 \
myProject.c -o myProject.o \
-L/usr/local/Cellar/imagemagick/6.8.9-7/lib \
-lMagickWand-6.Q16 \
-lMagickCore-6.Q1
To simplify the whole process, ImageMagick ships MagickWand-config utility. This will take care of libs, includes, and definitions for you.
example:
CFLAGS=$(MagickWand-config --cflags)
LFLAGS=$(MagickWand-config --libs)
clang $CFLAGS myProject.c -o myProject.o $LFLAGS

Still get 'curl/curl.h: No such file or directory' in spite of all looks proper

I installed on windows curl 7.28.0 from curl-7.28.1-devel-mingw32.zip through minGW console to default directory like:
./config && make && make install
All needed headers (aka curl.h, types.h ...) I see in C:\MinGW\msys\1.0\local\include\curl
libcurl.pc placed in C:\MinGW\msys\1.0\local\lib\pkgconfig\
libcurl.a, libcurl.dll.a and libcurl.la placed in C:\MinGW\msys\1.0\local\lib.
My download_file.c file includes are:
...
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
...
I try to compile the C code with followed command through gcc:
$ gcc -IC:/MinGW/msys/1.0/include/
-IC:/MinGW/msys/1.0/local/include/curl
-IC:/MinGW/msys/1.0/local/lib/pkgconfig
-o download_file download_file.c -llibcurl -lcurl
with absolute path get the same error:
gcc -I/include/
-I/local/include/curl
-I/local/lib/pkgconfig
-o download_file download_file.c -llibcurl -lcurl
But I still get an error:
download_file.c:21:23: fatal error: curl/curl.h: No such file or directory compilation terminated.
row 21 is #include <curl/curl.h>
What I did wrong? Please help.
You have the curl/ directory in the source code, but also in the option.
It seems the option should point out the higher-level directory in which curl/ is, so it should be something like:
-I/local/include/
I think the problem is likely that you give your include paths on the command line in the Win32 path format. This is not the same as the one used by msys (or ultimately Cygwin).
Try these:
$ gcc -I/include/
-I/local/include/curl
-I/local/lib/pkgconfig
...
Hope I got the absolut paths right, but you can check in your msys shell.
What ticked me off was that you use ./config, which wouldn't work from the Command Prompt, but works from the msys shell. So you need to give paths that all the programs in MinGW understand.
Basically, most programs in MinGW only have the concept of a single file system root, like on any unixoid system, while Win32 has multiple (the drive letters). Since the MinGW programs are linked accordingly, you need to give paths that they understand.
Thank you very much to #0xC0000022L and #unwind. By your help I fixed my problem.
0xC0000022L you are right about absolute path
unwind you are right about -I/local/include/ instead -I/local/include/curl
I found other problem: -L/local/lib instead -I/local/lib.
So this is a working command:
gcc -I/include/
-I/local/include
-L/local/lib
-o download_file download_file.c -llibcurl -lcurl

Resources