roelj / inklingreader

A GNU/Linux-friendly version of the Wacom Inkling SketchManager.
GNU General Public License v3.0
50 stars 16 forks source link

Compile issue on ubuntu 12.04 precise #1

Closed MeraX closed 10 years ago

MeraX commented 10 years ago

Hey roelj,

this project looks really interesting. I just copied your your project and tried to compile it. I'm running a 64bit precise and have (at least) installed these packages: libgtk-3-dev, libcairo2-dev, build-essential, librsvg2-dev, libglib2.0-dev

The output of make is:

gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o main.o src/main.c
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o mainwindow.o src/gui/mainwindow.c
src/gui/mainwindow.c: In Funktion »gui_init_mainwindow«:
src/gui/mainwindow.c:57:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_new« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:57:12: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung [standardmäßig aktiviert]
src/gui/mainwindow.c:77:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_set_direction« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:77:3: Warnung: Implizite Deklaration der Funktion »GTK_MENU_BUTTON« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:78:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_set_popup« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o mainwindow_sig.o src/gui/mainwindow_sig.c
src/gui/mainwindow_sig.c: In Funktion »gui_mainwindow_document_view_draw«:
src/gui/mainwindow_sig.c:243:6: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o svg.o src/converters/svg.c
src/converters/svg.c: In Funktion »co_svg_create«:
src/converters/svg.c:99:3: Warnung: Format ist kein Zeichenkettenliteral, und keine Formatargumente [-Wformat-security]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o png.o src/converters/png.c
src/converters/png.c: In Funktion »co_png_export_to_file_from_handle«:
src/converters/png.c:39:3: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o pdf.o src/converters/pdf.c
src/converters/pdf.c: In Funktion »co_pdf_export_to_file_from_handle«:
src/converters/pdf.c:38:3: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o wpi.o src/parsers/wpi.c
src/parsers/wpi.c: In Funktion »p_wpi_parse«:
src/parsers/wpi.c:101:9: Warnung: Der Rückgabewert von »fread«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o straight_lines.o src/optimizers/straight_lines.c
gcc `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --libs` -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags` main.o mainwindow.o mainwindow_sig.o svg.o png.o pdf.o wpi.o straight_lines.o -o InklingReader
mainwindow.o: In function `gui_init_mainwindow':
mainwindow.c:(.text+0x22): undefined reference to `gtk_init'
mainwindow.c:(.text+0x29): undefined reference to `gtk_window_new'
mainwindow.c:(.text+0x33): undefined reference to `gtk_menu_button_new'
mainwindow.c:(.text+0x3b): undefined reference to `gtk_menu_new'
[skipping more lines with undefined gtk references]
mainwindow_sig.c:(.text+0x439): undefined reference to `gtk_container_add'
mainwindow_sig.o: In function `gui_mainwindow_document_view_draw':
mainwindow_sig.c:(.text+0x48f): undefined reference to `gtk_widget_get_allocated_width'
mainwindow_sig.c:(.text+0x4cf): undefined reference to `cairo_translate'
mainwindow_sig.c:(.text+0x4e2): undefined reference to `cairo_scale'
mainwindow_sig.c:(.text+0x521): undefined reference to `rsvg_handle_new_from_data'
mainwindow_sig.c:(.text+0x541): undefined reference to `rsvg_handle_render_cairo'
mainwindow_sig.o: In function `gui_mainwindow_export_activated':
mainwindow_sig.c:(.text+0x302): undefined reference to `g_free'
svg.o: In function `co_svg_create':
svg.c:(.text+0x15): undefined reference to `g_slist_length'
svg.c:(.text+0x3c): undefined reference to `g_slist_length'
png.o: In function `co_png_export_to_file_from_handle':
png.c:(.text+0x20): undefined reference to `cairo_image_surface_create'
png.c:(.text+0x2b): undefined reference to `cairo_create'
png.c:(.text+0x3b): undefined reference to `rsvg_handle_render_cairo'
png.c:(.text+0x46): undefined reference to `cairo_surface_write_to_png'
png.c:(.text+0x52): undefined reference to `cairo_destroy'
png.c:(.text+0x5a): undefined reference to `cairo_surface_destroy'
png.o: In function `co_png_export_to_file':
png.c:(.text+0x8c): undefined reference to `rsvg_handle_new_from_data'
pdf.o: In function `co_pdf_export_to_file_from_handle':
pdf.c:(.text+0x18): undefined reference to `cairo_pdf_surface_create'
pdf.c:(.text+0x23): undefined reference to `cairo_create'
pdf.c:(.text+0x33): undefined reference to `rsvg_handle_render_cairo'
pdf.c:(.text+0x3b): undefined reference to `cairo_surface_show_page'
pdf.c:(.text+0x43): undefined reference to `cairo_surface_finish'
pdf.c:(.text+0x4b): undefined reference to `cairo_destroy'
pdf.c:(.text+0x53): undefined reference to `cairo_surface_destroy'
pdf.o: In function `co_pdf_export_to_file':
pdf.c:(.text+0x7d): undefined reference to `rsvg_handle_new_from_data'
wpi.o: In function `p_wpi_parse':
wpi.c:(.text+0x101): undefined reference to `g_base64_encode'
wpi.c:(.text+0x21e): undefined reference to `g_slist_prepend'
wpi.c:(.text+0x39d): undefined reference to `g_slist_prepend'
wpi.c:(.text+0x3ba): undefined reference to `g_slist_reverse'
collect2: ld gab 1 als Ende-Status zurück
make: *** [InklingReader] Fehler 1

I'm sorry for the german localization, but may be you can help me out and tell me what I'm doing wrong. If you need more information, tell me.

roelj commented 10 years ago

Hello MeraX,

Thank you for your report. It looks like you're missing some development libraries. I'm installing Ubuntu 12.04 64-bit in a VM so I can have a look which ones you need.

roelj commented 10 years ago

I have reproduced the problems in Ubuntu. This looks like our problem: http://stackoverflow.com/questions/11546877/compiling-and-linking-gtk-3-with-c-project-on-ubuntu

But I haven't been able to fix it with the provided solution. I'll have to do more research.

roelj commented 10 years ago

With the most recent changes you should be able to compile the program without installing any other libraries using:

make win32

Just running "make" gives the trouble that is described by the problem: http://stackoverflow.com/questions/11546877/compiling-and-linking-gtk-3-with-c-project-on-ubuntu

MeraX commented 10 years ago

Yeah, that actually works! Thank you very much.