Code::Blocks
September 01, 2014, 08:29:10 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from  http://www.codeblocks.org/downloads/26 .
 
   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 3141 times)
gnosy
Guest
« 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");
    gtk_widget_show(window);
    gtk_main();
    return 0;
}
error:
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!
gnosy
Logged
Ceniza
Developer
Lives here!
*****
Offline Offline

Posts: 1442



WWW
« 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.
Logged
stahta01
Lives here!
****
Online Online

Posts: 4347


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

FYI:

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.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
 

Tim S.
Logged

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!