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

PCH / MPLAB Linker problems

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



Joined: 26 Oct 2008
Posts: 15

View user's profile Send private message

PCH / MPLAB Linker problems
PostPosted: Wed Oct 29, 2008 11:11 am     Reply with quote

I've decided to split my source into separate .c/.h files and before doing this I'm trying to build the MCU project example given by CCS.

Everything compiles, but the linker fails ...

Code:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "main.c" +EXPORT I+="C:\Program Files\PICC\Drivers"  +LN +T +A +M -Z +Y=9 +EA
D:\Matthew\Electronics\MCU\main.o ===>  0 Errors,  0 Warnings.
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "filter.c" +EXPORT I+="C:\Program Files\PICC\Drivers"  +LN +T +A +M -Z +Y=9 +EA
D:\Matthew\Electronics\MCU\filter.o ===>  0 Errors,  0 Warnings.
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "report.c" +EXPORT I+="C:\Program Files\PICC\Drivers"  +LN +T +A +M -Z +Y=9 +EA
D:\Matthew\Electronics\MCU\report.o ===>  0 Errors,  0 Warnings.
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH LINK="MCU.hex=main.o,filter.o,report.o" +LN +T +A +M -Z +Y=9 +EA
Link step failed.
BUILD FAILED: Wed Oct 29 16:53:15 2008


It gives no reason why it's failed, just "Link step failed". I've tried reinstalling both MPLAB and CCS and this doesn't help. One thing I note though is that the same set of flags is passed to each .c file. Also when I run the "buildall.bat" file in the example directory, everything is fine and the hex file is produced. Any ideas ? Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 29, 2008 11:23 am     Reply with quote

How to use multiple source files with MPLAB:
http://www.ccsinfo.com/forum/viewtopic.php?t=34046

More detailed information on using multiple files with MPLAB.
Read all the links in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=32221
matt1971



Joined: 26 Oct 2008
Posts: 15

View user's profile Send private message

PostPosted: Wed Oct 29, 2008 11:36 am     Reply with quote

Great, so don't actually do it in a logical manner, do it in a quirky "CCS" manner.

Maybe that explains why their shipped files often don't compile and why eventually you end up rewriting your own libraries anyway.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 29, 2008 11:44 am     Reply with quote

CCS has a linker but it only works with their IDE (PCW, PCWH, PCWHD).
There are a few other features like that, such as the Statistics file.
They want you to buy their IDE.

For me, I would rather have a low cost compiler and use it with MPLAB.
If I lose a few extra features, it doesn't bother me.
matt1971



Joined: 26 Oct 2008
Posts: 15

View user's profile Send private message

PostPosted: Wed Oct 29, 2008 11:51 am     Reply with quote

I tend to agree. I used their IDE and really didn't like it at all. MPLAB isn't brilliant, but it certainly better than the CCS one. And infinitely cheaper!
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