Code::Blocks Forums
User forums => Help => Topic started by: gnosy 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
-
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.
-
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.