On Fri, Dec 19, 2008 at 4:40 AM, Pierrick Grasland <span dir="ltr"><<a href="mailto:pierrick.grasland@gmail.com">pierrick.grasland@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I just tried FindGTK2.cmake<br><br>It correctly locate GTK2 library, but when I trying to build my project, GCC output a lot of error in GTK lib ...<br><br>It seems to be unable to find definition of GTK.<br><br>
I copy / paste here my CMakeLists.txt (I think I forgot something) :<br style="color: rgb(51, 51, 255);"><div style="margin-left: 40px;"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">SET(CMAKE_MODULE_PATH "/home/bobby/workspace/SipSec/gui")</span><div class="Ih2E3d">
<br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">FIND_PACKAGE(GTK2 COMPONENTS gtk)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">include_directories (${GTK2_GTK_INCLUDE_DIR})</span><div class="Ih2E3d">
<br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">set( GUI_SRC gtkCallback.c interface.c widgetUI.c)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">add_library (sipsecgui ${GUI_SRC} ${GTK2_GTK_LIBRARIES}) </span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">target_link_libraries(sipsecgui ${GTK2_GTK_LIBRARIES} ) </span><br></div><br><br>and some errors from GCC output :<br><br style="color: rgb(204, 0, 0);"><div style="margin-left: 40px;">
<span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextbufferrichtext.h:90: erreur: expected declaration specifiers before «G_END_DECLS»</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">In file included from /usr/include/gtk-2.0/gtk/gtk.h:176,</span><br style="color: rgb(204, 0, 0);">
<span style="color: rgb(204, 0, 0);"> from /home/bobby/workspace/SipSec/gui/gtkCallback.h:12,</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);"> from /home/bobby/workspace/SipSec/gui/gtkCallback.c:7:</span><br style="color: rgb(204, 0, 0);">
<span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextview.h:53: erreur: expected declaration specifiers before «GtkTextWindowType»</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextview.h:57: erreur: storage class specified for parameter «GtkTextView»</span></div>
</blockquote><div><br><br>Due to GTK's dependencies (header files in a dozen different directories and many libraries) when using this module you should use:<br><br>INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})<br>and<br>
TARGET_LINK_LIBRARIES(foo ${GTK2_LIBRARIES})<br><br>The module appends all the stuff in two large lists exposed as GTK2_INCLUDE_DIRS and GTK2_LIBRARIES.<br><br></div></div>-- <br>Philip Lowman<br>