Board index » cppbuilder » How to include header files and other files??

How to include header files and other files??

I have BCB 5.
I have a c file that contains main() and it calls some  functions that
are defined in another c file, one that one has no main(), but is
basically just has the function definitions.

Both c files have an include statement ("#include "header1.h")
that includes this  header file--the header file defines some constants
and has all the function declarations.

I cannot make or build this project because I keep gettting an error
linking on one of the functions. "external error" or something like
that. THere is only one function called from  main() and that is what
the error says: bascially it can't find this function.
So, what exactly is the procedure for telling BCB5 that I want to use
these 2 files (the auxiliary source file and header file)???
I get the same problem using VC++ 5, too.

Sent via Deja.com http://www.deja.com/
Before you buy.

 

Re:How to include header files and other files??


Randy schrieb:

Quote

> I have BCB 5.
> I have a c file that contains main() and it calls some  functions that
> are defined in another c file, one that one has no main(), but is
> basically just has the function definitions.

> Both c files have an include statement ("#include "header1.h")
> that includes this  header file--the header file defines some constants
> and has all the function declarations.

> I cannot make or build this project because I keep gettting an error
> linking on one of the functions. "external error" or something like
> that. THere is only one function called from  main() and that is what
> the error says: bascially it can't find this function.
> So, what exactly is the procedure for telling BCB5 that I want to use
> these 2 files (the auxiliary source file and header file)???
> I get the same problem using VC++ 5, too.

IF you want to use  functions from 2 files vice versa, you
need:

a) include the other .cpp's .h-File with #include
b) have both .cpp's in your project (add to project)

                                                              Andreas

Other Threads