3000GTCapri
Oct 21 2009, 06:57 PM
Hi
I am writing a automation program in c.
I would like to have all my functions stored in an external file
and have my main program call up these external functions.
thus keeping my main source file reletively clutter free, just calling each function from external files.
I am having trouble getting them linked, as my main source file can't find the external function.
I also created a header file to define my function type.
Could some one please give me a simple example,
of calling a function from another .c file.
Thanks in advance.
MarcD
Oct 22 2009, 08:40 AM
Um.. It should be a simple matter of adding a #include<blah.h> into the source (where blah.h is the header file that you just created).
3000GTCapri
Oct 22 2009, 06:43 PM
done that mate, won't link
n_one
Oct 22 2009, 07:42 PM
MarcD
Oct 22 2009, 08:46 PM
QUOTE (3000GTCapri @ Oct 22 2009, 06:43 PM)

done that mate, won't link
Paste an example of what you have.
8URVTEC
Oct 22 2009, 08:48 PM
Yeah if u wannt to link tour files then
#include<blah.h>
but u have to set private an public functions then make a parametrized constructors to call the functions.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.