News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

build a simple gcc,got error:gtk/gtk.h: No such file or directory

Started by gnosy, November 01, 2009, 06:39:32 AM

Previous topic - Next topic

gnosy

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

Ceniza

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.

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]