Thread: Help with GTK+-3.0
hi all.
writing basic text editor using gtk+-3.0 , c language duke of edinburgh's silver award.
have set eclipse ide compile gtk+-3.0 applications. following error when compile code:
building target: james-edit
invoking: gcc c linker
gcc -o"james-edit(eclipse-only)" ./src/main.o `pkg-config --libs --cflags gtk+-3.0`
./src/main.o: in function `func_open_dialog':
/home/james/workspace/james-edit (eclipse-only)/debug/../src/main.c:151: undefined reference `open_file'
collect2: ld returned 1 exit status
make: *** [james-edit(eclipse-only)] error 1
error following function:
any appreciated.code:void func_open_dialog(void) { gtkwidget *open_dialog; open_dialog = gtk_recent_chooser_dialog_new ("open", null, gtk_stock_cancel, gtk_response_cancel, gtk_stock_open, gtk_response_accept, null); if (gtk_dialog_run (gtk_dialog (open_dialog)) == gtk_response_accept) { gtkrecentinfo *info; info = gtk_recent_chooser_get_current_item (gtk_recent_chooser (open_dialog)); open_file (gtk_recent_info_get_uri (info)); gtk_recent_info_unref (info); } gtk_widget_destroy (open_dialog); }@ guess linker, not including header file should there?
james
the linker doesn't care header files. if didn't include right header file, compile should fail before linker. suppose it's possible compiler used bad default function prototype in absence of header file, not problem.
linker can't find open_file function. correct function name? , if so, function defined?
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Help with GTK+-3.0
Ubuntu
Comments
Post a Comment