Eclipse의 C/C++ 버전을 둘러보고 간단한 GTK 앱을 작성하려고합니다. 그러나 Eclipse 내에서 GTK 샘플을 컴파일 할 수없는 것 같습니다.Eclipse 내에서 C++/GTK 컴파일하기
나는 GTK가 제대로 설치되었다고 생각하며, 우분투 패키지 관리자를 사용했다.
#include <gtk-2.0/gtk/gtk.h>
int main(int argc, char *argv[])
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main();
return 0;
}
나는 명령 라인 패턴 "pkg-config --cflags --libs gtk+-2.0"
을 설정하는 지침을 here을 따랐다 그러나 나는 이러한 오류 얻을 :
코드는 조금 얻기
Building file: ../src/GTKtestC.c
Invoking: GCC C Compiler
gcc -I/usr/include/gtk-2.0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/GTKtestC.d" -MT"src/GTKtestC.d" -o"src/GTKtestC.o" "../src/GTKtestC.c" pkg-config --cflags --libs gtk+-2.0
gcc: pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
cc1: error: unrecognized command line option "-fcflags"
cc1: error: unrecognized command line option "-flibs"
make: *** [src/GTKtestC.o] Error 1
을 좌절, 많은 도움을 많이 받았다