LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   error when compiling example gtkimageview (https://www.linuxquestions.org/questions/programming-9/error-when-compiling-example-gtkimageview-928949/)

pjg711 02-12-2012 09:15 AM

error when compiling example gtkimageview
 
Hello,
When I try to compile with cmake gtkimageview an example I get this error:
------------------------------------------------
[100%] Building C object CMakeFiles/main.dir/interactive.c.o
Linking C executable main
/usr/bin/ld: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libgtk-x11-2.0.so: undefined reference to symbol 'gdk_draw_pixbuf'
/usr/bin/ld: note: 'gdk_draw_pixbuf' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libgdk-x11-2.0.so so try adding it to the linker command line
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libgdk-x11-2.0.so: could not read symbols: Invalid operation
collect2: ld devolvió el estado de salida 1
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2


This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig)
pkg_check_modules(GTK gtk+-2.0)
include_directories(${GTK_INCLUDE_DIRS})

INCLUDE_DIRECTORIES(../../.
../../src)

## Libreria gtkimageviewer
ADD_LIBRARY(VIEWER ../../src/cursors.c
../../src/gtkanimview.c
../../src/gtkimagenav.c
../../src/gtkimagetooldragger.c
../../src/gtkimagetoolselector.c
../../src/gtkimageview-marshal.c
../../src/gtkzooms.c
../../src/utils.c
../../src/gdkpixbufdrawcache.c
../../src/gtkiimagetool.c
../../src/gtkimagescrollwin.c
../../src/gtkimagetoolpainter.c
../../src/gtkimageview.c
../../src/gtkimageview-typebuiltins.c
../../src/mouse_handler.c
)

ADD_EXECUTABLE(main interactive.c )

TARGET_LINK_LIBRARIES(main ${GTK_LIBRARIES} VIEWER)
--------------------------

Thank you very much.
Pablo from Rosario,
Argentina

knudfl 02-13-2012 03:21 AM

Welcome to LQ.

Looks like Ubuntu 11.10
http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html


Assume the git version of gtkimageview http://trac.bjourne.webfactional.com/
→ svn co http://publicsvn.bjourne.webfactional.com/gtkimageview


There are two build systems included, waf and autotools.
Both works perfectly : 1) ./waf configure && ./waf
2) ./autogen.sh && make


I guess you will have to do those two first, and see how
the code is generated, and then use the same CFLAGS etc.
when adding a cmake build system.
http://www.cmake.org/Wiki/CMake_Useful_Variables
http://www.cmake.org/cmake/help/documentation.html
.


All times are GMT -5. The time now is 03:44 PM.