I’m using ccs 5.008 vet.
I compile 1 c file with main function and multiple h files (I include them) and everything is great!
When I’m adding c file to the source section (even if i empty without any code) I get problem compile the project.
The error is about the production hex file.
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
Posted: Thu May 30, 2019 6:41 am
This is probably because CCS is a single pass compiler. You will need to put that file in your headers and #include it in your main c source file. You can look at the examples in the examples folder to see how they did that.
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
Posted: Thu May 30, 2019 8:05 am
Yes.
That you are referring to a 'source section', implies you are using MPLAB.
In MPLAB, _only_ the main .c file should be put into this.
Every other file (whether .c, or .h), must be put into the 'headers' section.
MPLAB 'assumes' it is using a linker, rather than a single pass compiler.
So it assumes every .c file is separately compiled.
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