View previous topic :: View next topic |
Author |
Message |
matt1971
Joined: 26 Oct 2008 Posts: 15
|
PCH / MPLAB Linker problems |
Posted: Wed Oct 29, 2008 11:11 am |
|
|
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
|
|
|
matt1971
Joined: 26 Oct 2008 Posts: 15
|
|
Posted: Wed Oct 29, 2008 11:36 am |
|
|
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
|
|
Posted: Wed Oct 29, 2008 11:44 am |
|
|
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
|
|
Posted: Wed Oct 29, 2008 11:51 am |
|
|
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! |
|
|
|