including my own .h files....



This is a really stupid question:
I made my own .h file, two .c files. They include the same .h file, in
which I put a shared function declaration, which is then written down in
one of the .c files.
During compilation, the other .c file complains about undefined references
to that function:

[rbultje tux linux_studio-0.11]$ make
gcc `gtk-config --cflags` -g -Wall   -c -o tvplug.o tvplug.c
tvplug.c: In function `gtk_tv_filter':
tvplug.c:41: warning: unused variable `xve'
tvplug.c:48: warning: unused variable `xpe'
tvplug.c: In function `create_tv_plug':
tvplug.c:164: warning: assignment from incompatible pointer type
tvplug.c:165: warning: unsigned int format, pointer arg (arg 2)
tvplug.c:165: warning: unsigned int format, pointer arg (arg 3)
tvplug.c:174: warning: passing arg 4 of `XvPutVideo' from incompatible
pointer type
tvplug.c:66: warning: unused variable `c'
gcc studio.c -o studio `gtk-config --cflags` -g -Wall `gtk-config --libs
gthread` -L/usr/X11R6/lib -lXv -lXxf86vm -lXxf86dga  -lXaw3d -lXmu -lXt 
-lSM -lICE -lXext -lX11
studio.c: In function `start_lavrec':
studio.c:189: warning: control reaches end of non-void function
/tmp/cc3fgYob.o: In function `main':
/home/rbultje/linux_studio-0.11/studio.c:575: undefined reference to
`create_tv_plug'
collect2: ld returned 1 exit status
make: *** [studio] Error 1
[rbultje tux linux_studio-0.11]$ 

Here is a part of my tvplug.h:
GtkWidget* create_tv_plug(GtkWidget *object, int port_);

This file is also in tvplug.c. studio.c calls this function:
vbox = create_tv_plug(vbox, 42);

How do I 'link' this function so both files will see it?

Ronald





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]