View previous topic :: View next topic |
Author |
Message |
brushhead
Joined: 19 Mar 2004 Posts: 1
|
Hiding data between C modules. |
Posted: Fri Mar 19, 2004 7:55 am |
|
|
Hello,
I want to be able to specify a main module which contains my main() function in main.c. I then want to be able to be able to implement some other function in another module, made up of module1.c, and the declaration of the function in module1.h. I should be able to get at the function, by including module1.h in my main.c file, and then accessing the function in module.c from my main function.
I should be able to do this, certainly in C++, but is this not available to me in C?
Cheers,
Rob Wilson |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
No Linker in CCS |
Posted: Fri Mar 19, 2004 8:42 am |
|
|
The CCS software does not have a linker like C++ (or HiTech) so you have to <INCLUDE> all your modules/submodules in MAIN.C somewhere.
However, you can <include> them at the end of MAIN.C and use the standard prototype (or an .H file with the prototypes) at the start if you dont want them all up front.
Regards |
|
|
guest Guest
|
yes, sad really |
Posted: Sat Apr 24, 2004 12:09 am |
|
|
I've just read this reply, and my heart sank. I have never come across such a serious limitation in a compiler tool set. Oh, well, CANDO. |
|
|
Steve H Guest
|
|
Posted: Sat Apr 24, 2004 8:47 pm |
|
|
Golly - This is a PIC with very limited resources, not some PC with 512 megs of RAM. You can relocate 20 megs of program space nearly anywhere in 512 meg of ram. On a PIC when every bit counts it's not such a wise thing to do.
I like the simple/straightforward way that this compiler works - no funny business going on behind my back.
Steve H. |
|
|
|