나는 GTK +를 사용하고 있는데 어떤 이유로 내 화면 캡처 기능은 오류로 컴파일 실패 :이 C++ 코드가 컴파일되지 않는 이유는 무엇입니까?
main.cpp:17:97: error: ‘gdk_pixbuf_get_from_drawable’ was not declared in this scope
어떤 .H 파일 gdk_pixbuf_get_from_drawable가에 선언? 아래 코드는 다음과 같습니다.
#include <libCrossLibs.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
ILibraryInstance* inst;
GdkPixbuf* get_screenshot() {
GdkPixbuf* screenshot;
GdkWindow* rootWindow;
gint x_orig, y_orig;
rootWindow = gdk_get_default_root_window();
gint width, height;
width = gdk_window_get_width(rootWindow);
height = gdk_window_get_height(rootWindow);
gdk_window_get_origin(rootWindow,&x_orig,&y_orig);
screenshot = gdk_pixbuf_get_from_drawable(NULL, rootWindow,
NULL, x_orig, y_orig, 0, 0, width, height);
return screenshot;
}
int main(void) {
inst = InitializeLibraries();
}
gtk' 문서 '에 따르면,'기능이 gdk_pixbuf_get_from_drawable' GDK/gdk.h' '로 정의한다 (http://developer.gnome.org/gdk/stable/gdk-Pixbufs.html) –
어떤 프로젝트에 이미 포함되어 있습니까 – IDWMaster
이것은 좋은 질문이었습니다, 그것은 unfortutantely 닫았지만 같은 문제가 있었고 아래의 해결책은 나에게도 해결책이었습니다. – Noitidart