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 CCS Technical Support

Using version4 linker in MPLAB project

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



Joined: 23 Mar 2007
Posts: 1

View user's profile Send private message

Using version4 linker in MPLAB project
PostPosted: Fri Mar 23, 2007 10:43 am     Reply with quote

Hi All,

So I'm new to the PIC game, though not embedded programming. Truth is, I freaked when I heard there wasn't a linker, and *that* was why .c files were being #included (what????). Then I read some more, and found out that from version 4 on there is a linker (although CCS seems to shy away from actually telling anyone about it in anything more than a whisper - weird). So I rewrote the horrifically non-structured, all-global code to something approaching code that would allow me to retain my sanity during development and debugging. I then created an MPLAB project with all the .c files, added #export(relocatable) commands to each module, then tried to compile. Fine, they all produce object files. Then I tried to figure out how to get them to link. My first instinct was to create a dummy .c file that imports all the .o files. While this seems to sort-of try to work, it always gives me an over-ROM error that I don't get otherwise. And by otherwise, I mean my test to see if I could build this just using the command-line, a'la...

"c:\Program Files\PICC\ccsc" +FM +DF +LN +T -A +M +Z +ICD +Y=9 +EA +EXPORT fade.c
"c:\Program Files\PICC\ccsc" +FM +DF +LN +T -A +M +Z +ICD +Y=9 +EA +EXPORT main.c
"c:\Program Files\PICC\ccsc" +FM +DF +LN +T -A +M +Z +ICD +Y=9 +EA LINK="main.hex=main.o,fade.o"

(a few .c files ommitted for clarity)

From the command-line it builds fine. And I would just do that, except that MPLAB seems to need a project in order to be able to use the debugger. So I'm currently trying to figure out how build this in MPLAB. Basically, how do you use the linker in MPLAB?

And yes, I am new to PICs, so if I'm doing something silly or making incorrect assumptions, I pre-emptively claim no ego about any kind of PIC-programming-prowess.

Thanks!
Dan
P.S. I'm using Version 4.30 of the PCM compiler, on a 16f886. And trying to use an ICD2 if that makes any difference.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Fri Mar 23, 2007 12:35 pm     Reply with quote

Did you read the "Version 4 Comments" thread at the top of the page? If not, have a quick look at it and you'll quickly understand why CCS kind of 'whispers' about the linker.

CCS has a history of using paying customers to test their compiler, but they seriously screwed the pooch with the version 4 release. The only reason I'm still using it is that I'm too heavily invested in terms of both time & money to switch to anything else now.
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