LinuxForum.Fans
Тема

GTK+ 3.0

Автор: milvus 8 сообщений 1632 просмотров
#305646

как я не пробовал, накак не могу установить на Ubuntu
apt-get install libgtk2.0-dev
apt-get install libgtk3.0-dev
сначала вообще не видел gtk.h и gdk.h, я подсунул папки в include, теперь вот это!
все равно при компилировании программ выдаются ошибки

text

gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/code.d" -MT"src/code.d" -o"src/code.o" "../src/code.c" In file included from /usr/include/gdk/gdkapplaunchcontext.h:30:0, from /usr/include/gdk/gdk.h:32, from /usr/include/gtk/gtk.h:30, from ../src/code.h:17, from ../src/code.c:2: /usr/include/gdk/gdktypes.h:37:19: fatal error: cairo.h: No such file or directory

при попытке установить OpenCV выдает

text

ak@ak-desktop:~/OpenCV-2.4.3$ make
[  5%] Built target libtiff
[ 11%] Built target libjpeg
[ 15%] Built target libjasper
[ 24%] Built target IlmImf
[ 27%] Built target opencv_core
[ 32%] Built target opencv_imgproc
[ 32%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:98:1: error: ‘GtkType’ does not name a type
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: In function ‘GtkWidget* cvImageWidgetNew(int)’:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:138:18: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:138:18: error: ‘gtk_type_new’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:138:18: error: expected primary-expression before ‘)’ token
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:138:18: error: ‘GTK_CHECK_CAST’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: In function ‘void cvImageWidget_realize(GtkWidget*)’:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:154:3: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:154:3: error: ‘GTK_CHECK_TYPE’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:156:33: error: ‘GTK_REALIZED’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:156:45: error: ‘GTK_WIDGET_SET_FLAGS’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:158:26: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:159:26: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:160:30: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:161:31: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:168:14: error: ‘GdkWindowAttr’ has no member named ‘colormap’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:168:56: error: ‘gtk_widget_get_colormap’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:170:59: error: ‘GDK_WA_COLORMAP’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:171:11: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:171:44: error: ‘GtkWidget’ has no member named ‘parent’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:173:11: error: ‘GtkWidget’ has no member named ‘style’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:173:45: error: ‘GtkWidget’ has no member named ‘style’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:173:60: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:175:37: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:177:37: error: ‘GtkWidget’ has no member named ‘style’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:177:52: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: In function ‘void cvImageWidget_size_request(GtkWidget*, GtkRequisition*)’:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:193:36: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:193:36: error: expected primary-expression before ‘)’ token
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:193:36: error: ‘GTK_CHECK_CAST’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: In function ‘void cvImageWidget_set_size(GtkWidget*, int, int)’:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:221:36: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:221:36: error: expected primary-expression before ‘)’ token
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:221:36: error: ‘GTK_CHECK_CAST’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: In function ‘void cvImageWidget_size_allocate(GtkWidget*, GtkAllocation*)’:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:254:3: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:254:3: error: ‘GTK_CHECK_TYPE’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:257:11: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:258:18: error: ‘cvImageWidget_get_type’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:258:18: error: expected primary-expression before ‘)’ token
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:258:18: error: ‘GTK_CHECK_CAST’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:273:34: error: ‘GTK_WIDGET_REALIZED’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:275:22: error: expected primary-expression before ‘)’ token
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:281:19: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:282:19: error: ‘GtkWidget’ has no member named ‘allocation’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:283:43: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:291:43: error: ‘GtkWidget’ has no member named ‘window’
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp: At global scope:
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:300:24: error: variable or field ‘cvImageWidget_destroy’ declared void
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:300:24: error: ‘GtkObject’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:300:35: error: ‘object’ was not declared in this scope
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:100:25: warning: ‘parent_class’ defined but not used [-Wunused-variable]
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:147:1: warning: ‘void cvImageWidget_realize(GtkWidget*)’ defined but not used [-Wunused-function]
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:190:1: warning: ‘void cvImageWidget_size_request(GtkWidget*, GtkRequisition*)’ defined but not used [-Wunused-function]
/home/ak/OpenCV-2.4.3/modules/highgui/src/window_gtk.cpp:247:1: warning: ‘void cvImageWidget_size_allocate(GtkWidget*, GtkAllocation*)’ defined but not used [-Wunused-function]
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

В общем Help!

#305650
"milvus" написал:
/usr/include/gdk/gdktypes.h:37:19: fatal error: cairo.h: No such file or directory

Cairo кто ставить будет? Если установлен - значит, не той версии, либо ищется не там, где надо, либо это одна из особенностей ubuntu.

#305653

А не ли это вам нужно:

text

 libgtk-3-dev                               - development files for the GTK+ library 
 libgtk2.0-dev                              - development files for the GTK+ library

ЗЫ. И почему OpenCV не поставить из репозитория?

#305659
yars написал:
[quote="milvus"]/usr/include/gdk/gdktypes.h:37:19: fatal error: cairo.h: No such file or directory

Cairo кто ставить будет? Если установлен - значит, не той версии, либо ищется не там, где надо, либо это одна из особенностей ubuntu.[/quote]
я понимаю что он его не видит, но до этого я уже поперемещал папок 10 подсовывая в корневой каталог include невидимые Eclipsom файлы, думал что это дело в эклипсе, но вот и openCV тоже ругается
cairo/cairo.h есть но почему в gdk.h он прописан просто как #include <cairo.h> а не cairo/cairo.h, подсунуть чтоли сам файл в include? Там же такая помойка будет...!
Может я что-то капитально не понимаю, с линуксом вынужден работать на новой работе, поэтому особенностей его совсем не знаю

#305672
-=Serj=- написал:
А не ли это вам нужно:
text

 libgtk-3-dev                               - development files for the GTK+ library 
 libgtk2.0-dev                              - development files for the GTK+ library

ЗЫ. И почему OpenCV не поставить из репозитория?

пробовал разные варианты пишет что 52 пакета не обновлено
Извините за ламовской вопрос но что надо написать в терминале чтобы скачать скомпиленный установщик а потом что написать чтобы установить, просто была инструкция как собрать OpenCV, а как скачать установленный не знаю

#305674
"milvus" написал:
Может я что-то капитально не понимаю, с линуксом вынужден работать на новой работе, поэтому особенностей его совсем не знаю

Для начала, не советую собирать из исходников то, что есть в репозиториях. Если очень приспичит - собирайте пакет, который затем устанавливайте.
Иначе вы загадите систему, если не будете понимать, что происходит.

#305677
"milvus" написал:
Извините за ламовской вопрос но что надо написать в терминале чтобы скачать скомпиленный установщик а потом что написать чтобы установить, просто была инструкция как собрать OpenCV, а как скачать установленный не знаю

Если вам нужен OpenCV, достаточно просто:

text

$ sudo apt-get install libopencv-core2.3 libopencv-dev
#305929

Все равно при компиляции выдает ошибки отсутствия нужных библиотек, хотя openCV установилась и даже примеры какие-то скомпилировались, и заработали! Спасибо за подсказку, а как можно все старые GTK+ удалить и начисто поставить? Или я убъю весь графический интерфейс?

Войдите или зарегистрируйтесь, чтобы ответить.