GTK 컴파일 어떻게 하는건가요??

dkoread의 이미지

처음으로 글올려봅니다...

gcc -Wall -g hello.c -o hello `pkg-config --cflags gtk+-2.0` \
`pkg-config --libs gtk+-2.0`

이런식으로 컴파일 하니

밑에 글처럼 되더군요...왜 안되는건가요??

컴파일 조차 못하고있으니 답답할뿐입니다...-_-

http//bbs.kldp.org/viewtopic.php?t=58988&highlight=gtk+%C4%C4%C6%C4%C0%CF

이글보고 어떻게든 해볼라고 했지만 여전히 무리더군요...

왜 안되는걸까요??? 얼핏보기에는 gtk 경로지정이 안되는거같은데?

gtk 제가 현재 무슨 버젼을 사용하는지 알아볼려면 어떻게 해야하나요??

-----------------------------------------------------------------------

[chobo@localhost chobo]$ gcc -Wall -g hello.c -o hello `pkg-config --cflags gtk+-2.0` \ `pkg-config --libs gtk+-2.0`
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
gcc 그런 파일이나 디렉토리가 없음
hello.c121 gtk/gtk.h 그런 파일이나 디렉토리가 없음
hello.c In function `main'
hello.c5 `GtkWidget' undeclared (first use in this function)
hello.c5 (Each undeclared identifier is reported only once
hello.c5 for each function it appears in.)
hello.c5 `window' undeclared (first use in this function)
hello.c7 warning implicit declaration of function `gtk_init'
hello.c9 warning implicit declaration of function `gtk_window_new'
hello.c9 `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
hello.c10 warning implicit declaration of function `gtk_widget_show'
hello.c12 warning implicit declaration of function `gtk_main'

dragonkun의 이미지

pkg-config 의 결과를 가져오지 못하는 군요..
일단 /usr/share/pkgconifg/ 디렉토리에..
gtk+-2.0.pc 파일이 있나 확인해 보시고..
만약에 있으시다면..
export PKG_CONFIG_PATH=/usr/share/pkgconfig
후에 컴파일하시고..

없는 경우라면..
gtk 개발 툴들이 설치가 완벽히 안된 듯 하니..
뭔가 빠진 게 없나 살펴보는게 좋을 듯 합니다..

상황을 보아하니 gtk-config 역시 설치 안 되있을 수 도 있을 것 같지만..
혹시나 gtk-config가 설치되어 있다면

gcc -Wall -g hello.c -o hello `gtk-config --cflags` \
`gtk-config --libs` 

로 컴파일 하실 수 있을 겁니다.

Emerging the World!

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.