0

I bumped into green, a PDF viewer for the Framebuffer. I would like to compile it, but I am not having much success, although I have installed all the dependencies...

The error I am getting is:

$/home/Data/Software/green-0.2$ make
cc -D GREEN_SYSCONFIG_FILE=\"/usr/local/etc/green.conf\" -D GREEN_USERCONFIG_FILE=\".green.conf\" -Os -Wall -c main.c $(pkg-config poppler-glib --cflags) -o main.o
cc -Os -Wall -c green.c $(pkg-config poppler-glib --cflags) -o green.o
cc -Os -Wall -c sdl.c $(pkg-config poppler-glib --cflags) $(sdl-config --cflags) -o sdl.o
sdl.c: In function ‘GetInput’:
sdl.c:91:3: warning: case value ‘37’ not in enumerated type ‘SDLKey’ [-Wswitch]
sdl.c:85:3: warning: case value ‘123’ not in enumerated type ‘SDLKey’ [-Wswitch]
sdl.c:86:3: warning: case value ‘125’ not in enumerated type ‘SDLKey’ [-Wswitch]
sdl.c:94:3: warning: case value ‘126’ not in enumerated type ‘SDLKey’ [-Wswitch]
sdl.c:90:3: warning: case value ‘4294967207’ not in enumerated type ‘SDLKey’ [-Wswitch]
sdl.c: In function ‘RenderPage’:
sdl.c:120:2: error: unknown type name ‘GdkPixbuf’
sdl.c:120:2: warning: implicit declaration of function ‘gdk_pixbuf_new’ [-Wimplicit-function-declaration]
sdl.c:120:34: error: ‘GDK_COLORSPACE_RGB’ undeclared (first use in this function)
sdl.c:120:34: note: each undeclared identifier is reported only once for each function it appears in
sdl.c:136:2: warning: implicit declaration of function ‘poppler_page_render_to_pixbuf’ [-Wimplicit-function-declaration]
sdl.c:137:2: warning: implicit declaration of function ‘gdk_pixbuf_get_pixels’ [-Wimplicit-function-declaration]
sdl.c:137:9: warning: assignment makes pointer from integer without a cast [enabled by default]
sdl.c:138:2: warning: implicit declaration of function ‘gdk_pixbuf_get_rowstride’ [-Wimplicit-function-declaration]
sdl.c:139:2: warning: implicit declaration of function ‘gdk_pixbuf_get_n_channels’ [-Wimplicit-function-declaration]
sdl.c: In function ‘Green_SDL_Main’:
sdl.c:402:21: warning: variable ‘left_y’ set but not used [-Wunused-but-set-variable]
sdl.c:402:9: warning: variable ‘left_x’ set but not used [-Wunused-but-set-variable]
make: *** [sdl.o] Error 1
$:/home/Data/Software/green-0.2$

Obviously he can't find GdkPixbuf, but this construct is defined in:

# ls /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h 
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h

When I add to the file sdl.c the following line:

#include <gdk-pixbuf/gdk-pixbuf.h>

I am "greeted" with following error:

# make
cc -Os -Wall -c sdl.c $(pkg-config poppler-glib --cflags) $(sdl-config --cflags) -o sdl.o
sdl.c:20:35: fatal error: gdk-pixbuf/gdk-pixbuf.h: No such file or directory
compilation terminated.
make: *** [sdl.o] Error 1

My question is then, how do I "convince" gcc to compile this code?

Thanks in advance, Oz

UPDATE: adding the full path to gdk-pixbuf/gdk-pixbuf.h yields:

ozdeb@yenitiny:/home/Data/Software/green-0.2$ make
cc -D GREEN_SYSCONFIG_FILE=\"/usr/local/etc/green.conf\" -D GREEN_USERCONFIG_FILE=\".green.conf\" -Os -Wall -c main.c $(pkg-config poppler-glib --cflags) -o main.o
cc -Os -Wall -c green.c $(pkg-config poppler-glib --cflags) -o green.o
cc -Os -Wall -c sdl.c $(pkg-config poppler-glib --cflags) $(sdl-config --cflags) -o sdl.o
sdl.c:21:63: warning: missing terminating " character [enabled by default]
sdl.c:21:63: warning: extra tokens at end of #include directive [enabled by default]
In file included from sdl.c:21:0:
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:32:44: fatal error: gdk-pixbuf/gdk-pixbuf-features.h: No such file or directory
compilation terminated.
make: *** [sdl.o] Error 1
2
  • /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h isn't the same as [/usr/include/]gdk-pixbuf/gdk-pixbuf.h Commented Jun 17, 2012 at 9:42
  • @RedGrittyBrick, then? is gdk-pixbuf depreciated? I could not find anywhere a package containing it, besides that. Plus, adding the full path, still does not compile... Commented Jun 17, 2012 at 9:45

1 Answer 1

0

Kind of an answer, not really fully compiling, but I managed to solve the part where sdl.c fails to compile with:

cc -c sdl.c `sdl-config --cflags` `pkg-config poppler-glib --cflags` `pkg-config gtk+-2.0 --cflags` -o sdl.o
Sign up to request clarification or add additional context in comments.

1 Comment

What error are you facing while compiling with the above mentioned command? By the way, gdk-pixbuf-2.0 is the package whose CFLAGS you might be looking for. It should be part of libgdk-pixbuf2.0-dev but once you include gtk+-2.0 that should have been included implicitly. Can you check what gtk+-2.0 pkg-config dependencies are pkg-config --print-requires gtk+-2.0? gdk-pixbuf-2.0 should have been part of it. FYI on Linux Mint 12 gdk-pixbuf is a dependency of poppler-glib as well, so the code compiles without issues

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.