newbie gcc question...

Michael Kahle geopoliticus@onebox.com
Mon Apr 29 18:21:00 GMT 2002


hello.  I hope this question is not creating any unnecessary noise. 
If it is, i apologize up front and ask you lead me to the correct faq
or other helpful document.

I am trying to teach myself the c language and a program I am creating
at compile time is giving me the error:

undefined reference to 'bla_bla1'
undefined reference to 'bla_bla2'
undefined reference to 'bla_bla3'
etc...

This is the first c program I have written that requires me to use the
#include directive in my program.
I have a file called
bla_bla.h
in this file i have the lines:
void bla_bla1(int);
int bla_bla2(int);
int bla_bla3(int);
I also have another file called
tbla_bla.c
that has the directive:
#include "bla_bla.h"
in it.  When I try and compile this I get the error above. The files
are all located in the same directory and I run gcc from that directory
with the following command line...
gcc -d -l bla_bla.h bla_bla.c -o bla_bla.o

What is causing this error?!  I know I am doing something wrong.  Unfortunatly
the O'Reilly book I am using for my learning (Practical C Programming)
doesn't give a hint as to what command line options I should be using
when using gcc to include header files.  I have poked around on the net
for my answer and tried quite a few different things.

Please help.  I am new to all of this so please be nice. :)

Thank you very much.

Michael 



More information about the Gcc-help mailing list