avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] HowTo split a program into several files ?


From: Vincent Trouilliez
Subject: [avr-chat] HowTo split a program into several files ?
Date: Mon, 12 Sep 2005 17:37:45 +0200

Hi,


It's about using GCC so I guess it's belong to the other list, but since
it's probably such a dumb question to all of you, I didn't want to
pollute the more "serious" gcc list ! ;-)


Once upon a time I used a couple cheap C compiler for Microchip PICs :
"CCS" and another one called "HiTech". In both of these IIRC, I could
just put whatever code into a file and a simple <include file> statement
in the main program file would be enough for the compiler to be happy.

But when I try to do that with gcc, it says that it can't find the
included file...

For example, I have two files :

main_prog.c which contains the body of the program, and a file "lcd.c"
that contains all the routines to use the LCD display, to keep things
tidy.
I just added an #include <lcd.c> at the top of main_prog.c, but gcc says
"No such file or directory". I tried making the path it more explicit :
#include <./lcd.c>, but still no joy.

How should I go about splitting my programs then, what is the
syntax/procedure gcc is expecting from me ?


Thanks... :-)



Regards,


--
Vince





reply via email to

[Prev in Thread] Current Thread [Next in Thread]