November 24, 2014, 08:38:50 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: When registered with our forums, feel free to send a "here I am" post in,14168.0.html to differ human beings from SPAM bots.
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: build a simple gcc,got error:gtk/gtk.h: No such file or directory  (Read 3210 times)
« on: November 01, 2009, 06:39:32 am »

my foo.c:
#include <gtk/gtk.h>
int main(int argc, char *argv[]) {
    GtkWidget *window;
    gtk_init(&argc, &argv);
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window), "hello");
    return 0;
C:\msys\1.0\home\Administrator\foo.c|1|gtk/gtk.h: No such file or directory|
C:\msys\1.0\home\Administrator\foo.c||In function `main':|
C:\msys\1.0\home\Administrator\foo.c|3|error: `GtkWidget' undeclared (first use in this function)|
C:\msys\1.0\home\Administrator\foo.c|3|error: (Each undeclared identifier is reported only once|
C:\msys\1.0\home\Administrator\foo.c|3|error: for each function it appears in.)|
C:\msys\1.0\home\Administrator\foo.c|3|error: `window' undeclared (first use in this function)|
C:\msys\1.0\home\Administrator\foo.c|5|error: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)|
||=== Build finished: 6 errors, 0 warnings ===|

thanks in advance!
Lives here!
Offline Offline

Posts: 1442

« Reply #1 on: November 01, 2009, 09:26:14 am »

This is NOT a general programming forum, and we do NOT provide support for any specific libraries (other than the Code::Blocks SDK).

Please ask your question in a relevant forum, mailing list or IRC channel ONLY after you have searched for it in a search engine (Google is a very good one) without finding an answer.
Lives here!
Offline Offline

Posts: 4454

« Reply #2 on: November 01, 2009, 05:50:49 pm »


C++ files are required to have the extension .cpp when using Code::Blocks.

Note: The above is just one of your problems; most likely need to add search directories inside Code::Blocks.

Turn on "Full Compiler Logging" and post results in a beginner site for simple how to code help.

Tim S.

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
When in doubt, read the CB WiKi FAQ.
Pages: [1]   Go Up
  Send this topic  |  Print  
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!