Closed robmarkcole closed 6 years ago
Hi,
you need to install the development packages for Imlib2 and probably X11 to compile ssocr. Every Imlib2 version I used required including the Xlib.h
header file to use the Imlib2.h
header file, which is necessary for using Imlib2.
I am sorry, but I cannot be more specific than that, because I do not have a mac.
Thanks, Erik
Hello, you can use it instead of make.
make CC='gcc -I/opt/X11/include'
Then make install
and run it :)
I did it with macOS Sierra 10.12.6.
@haradaa9 Thanks for that information. So the X11 headers are not in the default include path of the C compiler on (that version of) macOS, and imlib2-config --cflags
does not know about this.
A cleaner solution would be to use make CPPFLAGS=-I/opt/X11/include
to specify flags needed for the C preprocessor. The CPPFLAGS
variable is not set by the ssocr
Makefile
, and the -I
option tells the C preprocessor to add the given path to its search path for .h
files, so it logically belongs to the CPPFLAGS
variable.
This kind of problem is usually solved with something like GNU autoconf that knows about all the little differences between operating systems. I have been able to avoid that bloat so far, and I do not really like the idea of adding it. I'll think about this some more...
Thanks, Erik
I have received an email regarding build problems on Mac OS X 10.10.5, caused by the same problem (X11 headers are not found in the default include path).
The solution was to use make CPPFLAGS=-I/opt/X11/include
, but make CC='gcc -I/opt/X11/include'
did not work.
I have added information to the INSTALL
file that macOS users may need to add the X11 include path manually.
Root cause for the problem is a misconfigured system, i.e. imlib2-config --cflags
is supposed to emit the needed additional include path for X11 headers on macOS, since they are needed by Imlib2 (ssocr
itself does not use any X11 functionality).
I am closing this issue.
Small bump to an old thread, in case someone comes looking for this.
I managed to get ssocr to build on a 2020 m1 Mac mini (ie Apple Silicon), but had to use this command to make it work:
make CPPFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/
Thanks for the information!
I expect that this is another solution for the fatal error: 'X11/Xlib.h' file not found
error reported in this issue, and have just added this information to the INSTALL
file.
macOS High Sierra 10.13.3
I've installed
Imlib2
with brew, but onmake install
receive the error: