I have 3 files in my gtk + application:
main.c:
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "mainwindow.h"
int main(int argc, char** argv)
{
MainWin* win;
GError* err = NULL;
int a = 0;
a = some_foo();
gtk_main();
return 0;
}
mainwindo.h
#include <gtk/gtk.h>
typedef struct _MainWin
{
GtkWindow parent;
} MainWin;
GtkWidget* main_win_new();
int some_foo();
MainWindow.c
#include "mainwindow.h"
int some_foo()
{
return 1;
}
When I try to call some_fooin the main function and try to compile i, see the error: undefined reference to `some_foo '. What's wrong?
Thank.
source
share