CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PCM & Multiple Source Files under MPLAB

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ray Livingston
Guest







PCM & Multiple Source Files under MPLAB
PostPosted: Tue Aug 05, 2003 4:29 pm     Reply with quote

Using MPLAB 6.3, PCM 3.158: Is it possible to have multiple C source files? When I try, each module generates an error "Function referenced but not defined" on the all extern references. Because of these errors (which should not really be errors, as they are declared as extern....) the linker does not run.
Am I doing something wrong?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516691
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: PCM & Multiple Source Files under MPLAB
PostPosted: Tue Aug 05, 2003 5:30 pm     Reply with quote

:= Using MPLAB 6.3, PCM 3.158: Is it possible to have multiple C source files? When I try, each module generates an error "Function referenced but not defined" on the all extern references. Because of these errors (which should not really be errors, as they are declared as extern....) the linker does not run.

--------------------------------------------------------

It's not MPLAB. It's the compiler. It doesn't support
linking separate object modules together. You have to
#include all source modules in your main file. Then
compile it. See the following link for an example.
<a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/50.html</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516693
TS
Guest







Re: PCM & Multiple Source Files under MPLAB
PostPosted: Tue Aug 05, 2003 7:24 pm     Reply with quote

:=:= Using MPLAB 6.3, PCM 3.158: Is it possible to have multiple C source files? When I try, each module generates an error "Function referenced but not defined" on the all extern references. Because of these errors (which should not really be errors, as they are declared as extern....) the linker does not run.
:=
:=--------------------------------------------------------
:=
:=It's not MPLAB. It's the compiler. It doesn't support
:=linking separate object modules together. You have to
:=#include all source modules in your main file. Then
:=compile it. See the following link for an example.
:= <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank"> <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/50.html</a></a>

You are putting the C module files after the functions in the main file. Are you doing this so that if you use the modifier 'static' before a variable in a module (but not in a function in that module), it will have a scope limited to (will only be seen by) that module?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516696
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: PCM & Multiple Source Files under MPLAB
PostPosted: Tue Aug 05, 2003 8:49 pm     Reply with quote

There is but one and only one module for the CCS compiler. It doesn't really matter if you include them in the begining or end of the file.

:=:=:= Using MPLAB 6.3, PCM 3.158: Is it possible to have multiple C source files? When I try, each module generates an error "Function referenced but not defined" on the all extern references. Because of these errors (which should not really be errors, as they are declared as extern....) the linker does not run.
:=:=
:=:=--------------------------------------------------------
:=:=
:=:=It's not MPLAB. It's the compiler. It doesn't support
:=:=linking separate object modules together. You have to
:=:=#include all source modules in your main file. Then
:=:=compile it. See the following link for an example.
:=:= <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank"> <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank"> <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/50.html</a></a></a>
:=
:=You are putting the C module files after the functions in the main file. Are you doing this so that if you use the modifier 'static' before a variable in a module (but not in a function in that module), it will have a scope limited to (will only be seen by) that module?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516699
Ray Livingston
Guest







Re: PCM & Multiple Source Files under MPLAB
PostPosted: Wed Aug 06, 2003 9:21 am     Reply with quote

OK, that's the conclusion I reached. Thanks! Is the same true for PCW?

:=:=:= Using MPLAB 6.3, PCM 3.158: Is it possible to have multiple C source files? When I try, each module generates an error "Function referenced but not defined" on the all extern references. Because of these errors (which should not really be errors, as they are declared as extern....) the linker does not run.
:=:=
:=:=--------------------------------------------------------
:=:=
:=:=It's not MPLAB. It's the compiler. It doesn't support
:=:=linking separate object modules together. You have to
:=:=#include all source modules in your main file. Then
:=:=compile it. See the following link for an example.
:=:= <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank"> <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank"> <a href="http://www.pic-c.com/forum/general/posts/50.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/50.html</a></a></a>
:=
:=You are putting the C module files after the functions in the main file. Are you doing this so that if you use the modifier 'static' before a variable in a module (but not in a function in that module), it will have a scope limited to (will only be seen by) that module?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516714
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: PCM & Multiple Source Files under MPLAB
PostPosted: Wed Aug 06, 2003 5:13 pm     Reply with quote

:=You are putting the C module files after the functions in the main file. Are you doing this so that if you use the modifier 'static' before a variable in a module (but not in a function in that module), it will have a scope limited to (will only be seen by) that module ?
--------------------------------------------------------------

I don't think that feature of the "static" keyword works
in CCS, because CCS doesn't support linkable object modules.

I put the C source files at the end of the main file because
they're out of the way, and it makes it look nicer.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516733
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: PCM & Multiple Source Files under MPLAB
PostPosted: Wed Aug 06, 2003 5:15 pm     Reply with quote

:=:=You are putting the C module files after the functions in the main file. Are you doing this so that if you use the modifier 'static' before a variable in a module (but not in a function in that module), it will have a scope limited to (will only be seen by) that module?
----------------------------------------------------------
To TS:
I don't think that feature of the "static" keyword works
in CCS, because CCS doesn't support linkable object modules.
I put the C source files at the end of the main file because
they're out of the way, and it makes it look nicer.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516734
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group