Я пытаюсь следовать разделу 3.4.2, начиная со страницы 31 из this manual. Однако, как я настроил свою цель, чтобы быть DIABLO_ARMEL, а не DIABLO_X86, я получил разные результаты этой команды:Ошибка компилятора maemo scratchbox с gtk + -2.0
[sbox-DIABLO_X86: ~] > gcc -Wall -g gtk_helloworld-1.c \
‘pkg-config --cflags gtk+-2.0‘ -o gtk_helloworld-1 \
‘pkg-config --libs gtk+-2.0‘
[sbox-DIABLO_X86: ~] >
Я проверил CFLAGS и ЛИЭС результаты команды в одинарных кавычках перед входом в этой строке, и результаты между тем, что было описано в примере, и тем, что я увидел в окне команд.
Во всяком случае, я не ожидал, чтобы сообщения об ошибках появляются в терминале, но я получил следующее:
[sbox-DIABLO_ARMEL: ~] > gcc -Wall -g gtk-helloworld-1.c \
> 'pkg-config --cflags gtk+-2.0' -o gtk_helloworld-1 \
> 'pkg-config --libs gtk+-2.0'
sbox-arm-linux-gcc: pkg-config --cflags gtk+-2.0: No such file or directory
sbox-arm-linux-gcc: pkg-config --libs gtk+-2.0: No such file or directory
gtk-helloworld-1.c:15:21: gtk/gtk.h: No such file or directory
gtk-helloworld-1.c: In function `main':
gtk-helloworld-1.c:20: error: `GtkWindow' undeclared (first use in this function)
gtk-helloworld-1.c:20: error: (Each undeclared identifier is reported only once
gtk-helloworld-1.c:20: error: for each function it appears in.)
gtk-helloworld-1.c:20: error: `window' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `GtkLabel' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `label' undeclared (first use in this function)
gtk-helloworld-1.c:24: warning: implicit declaration of function `gtk_init'
gtk-helloworld-1.c:28: warning: implicit declaration of function `g_object_new'
gtk-helloworld-1.c:28: error: `GTK_TYPE_WINDOW' undeclared (first use in this function)
gtk-helloworld-1.c:34: error: `GTK_TYPE_LABEL' undeclared (first use in this function)
gtk-helloworld-1.c:39: warning: implicit declaration of function `gtk_container_add'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_CONTAINER'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_WIDGET'
gtk-helloworld-1.c:42: warning: implicit declaration of function `gtk_widget_show_all'
gtk-helloworld-1.c:45: warning: implicit declaration of function `g_print'
gtk-helloworld-1.c:46: warning: implicit declaration of function `gtk_main'
Я не уверен, что я делаю неправильно с точки зрения включаемые и конфигурации библиотеки. Было бы здорово, если бы кто-то мог дать некоторые советы по исправлению этой ошибки. Заранее спасибо.
+1 правильный ответ – rasjani
я не знаю, если я понял ваше предложение, но я пытался ввести ** НКУ -Wall -g gtk- helloworld-1.c 'pkg-config --cflgas gtk + -2.0' -o gtk-helloworld-1 'pkg-config -libs gtk + -2.0' ** все в одной строке и до сих пор не удалось создать программу. Я собираюсь проверить, есть ли у меня правильный пакет. – stanigator
вы снова забыли обратные кавычки ... 'цитата 'является обратной цитатой :) – elmarco