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

PCWH compiler issue

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



Joined: 18 Jul 2006
Posts: 103

View user's profile Send private message

PCWH compiler issue
PostPosted: Fri Jul 12, 2024 6:42 am     Reply with quote

We are using:
MPLAB X IDE v6.20
With a newly installed PCWH compiler
on a PIC16F1938 micro.

When I run the compiler I get the following list of errors.
Can anyone help with this?

CLEAN SUCCESSFUL (total time: 10ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make -f nbproject/Makefile-default.mk dist/default/production/BM44329.X.production.hex
make[2]: Entering directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'
gnumkdir -p build/default/production/_ext/70245343
"C:\Program Files (x86)\PCWH\CCSCON.exe" out=""build/default/production\_ext\70245343"" X:/BeadMaster/24L16.c +EXPORT +FM +EX +DF +CC +Y=9 +EA +DF +LN +T +A +M +J +Z -P #__16F1938=1 +EXPORTD="build/default/production/_ext/70245343"
Compiling X:\BeadMaster\24L16 on 12-Jul-24 at 08:40:
X:\BeadMaster\24L16.c:47:5: Error#100 USE parameter value is out of range Not a number: PIN_A5:
X:\BeadMaster\24L16.c:50:9: Error#128 A #DEVICE required before this line:
X:\BeadMaster\24L16.c:53:16: Error#12 Undefined identifier -- output_float:
X:\BeadMaster\24L16.c:54:16: Error#12 Undefined identifier -- output_float:
X:\BeadMaster\24L16.o ===> 4 Errors, 0 Warnings.:
Build Failed.:
make[2]: Leaving directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'
make[2]: Entering directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'
gnumkdir -p build/default/production/_ext/70245343
"C:\Program Files (x86)\PCWH\CCSCON.exe" out=""build/default/production\_ext\70245343"" X:/BeadMaster/BMlcd420.c +EXPORT +FM +EX +DF +CC +Y=9 +EA +DF +LN +T +A +M +J +Z -P #__16F1938=1 +EXPORTD="build/default/production/_ext/70245343"
Compiling X:\BeadMaster\BMlcd420 on 12-Jul-24 at 08:40:
X:\BeadMaster\BMlcd420.c:62:10: Error#128 A #DEVICE required before this line:
X:\BeadMaster\BMlcd420.o ===> 1 Errors, 0 Warnings.:
Build Failed.:
make[2]: Leaving directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'
make[2]: *** [nbproject/Makefile-default.mk:134: build/default/production/_ext/70245343/24L16.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [nbproject/Makefile-default.mk:146: build/default/production/_ext/70245343/BMlcd420.o] Error 1
make[2]: *** [nbproject/Makefile-default.mk:158: build/default/production/_ext/70245343/BM44329.o] Error 1
make[1]: *** [nbproject/Makefile-default.mk:85: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2
make[2]: Entering directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'
gnumkdir -p build/default/production/_ext/70245343
"C:\Program Files (x86)\PCWH\CCSCON.exe" out=""build/default/production\_ext\70245343"" X:/BeadMaster/BM44329.c +EXPORT +FM +EX +DF +CC +Y=9 +EA +DF +LN +T +A +M +J +Z -P #__16F1938=1 +EXPORTD="build/default/production/_ext/70245343"
Compiling X:\BeadMaster\BM44329 on 12-Jul-24 at 08:40:
X:\BeadMaster\BM44329.c:467:10: Error#7 Invalid Pre-Processor directive Invalid option:
X:\BeadMaster\BM44329.o ===> 1 Errors, 0 Warnings.:
Build Failed.:
make[2]: Leaving directory 'C:/Users/Ed/Desktop/70683_6F/BM44329.X'

BUILD FAILED (exit value 2, total time: 1s)[/code]
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 6:56 am     Reply with quote

I don't use any of that but.....
X:\BeadMaster\24L16.c:47:5: Error#100 USE parameter value is out of range Not a number: PIN_A5:
X:\BeadMaster\24L16.c:50:9: Error#128 A #DEVICE required before this line:
X:\BeadMaster\24L16.c:53:16: Error#12 Undefined identifier -- output_float:
X:\BeadMaster\24L16.c:54:16: Error#12 Undefined identifier -- output_float:

All errors are with the '24l16.c' file, that think is really a 'driver' and NOT a real 'main()' program.

Posting the first few lines of your real program would help !

just re-re-read the post...
X:\BeadMaster\BMlcd420.c:62:10: Error#128 A #DEVICE required before this line:

this line
X:\BeadMaster\BM44329.c:467:10: Error#7 Invalid Pre-Processor directive Invalid option:

maybe BM44329.c IS the main program ??
Really,really need to see 1st 20-30 lines of your program.

BMlcd420.c might be an LCD driver ??


Last edited by temtronic on Fri Jul 12, 2024 7:01 am; edited 2 times in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 6:57 am     Reply with quote

It looks as if you are trying to compile 24L16.c, then BMlcd420.c
The contents of the files are wrong. You are getting syntax errors on what
you are trying to compile. The main one is that you don't seem to be
loading the include file for the processor involved, so the compiler does
not know the pin name defines, or how things are defined. Even odder,
you seem to be trying to compile two files at once. You don't. You should
only have one main file for the project, and this should include any other
files like drivers.
edbfmi1



Joined: 18 Jul 2006
Posts: 103

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 8:43 am     Reply with quote

Here are the first few lines of code. Thanks for the help!

Code:
#include <16F1938.H>
#include <24L16.c>

//#include <16f1939.H>
// #include <16c77.H>
//#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT
#fuses XT, NOWDT, NOPROTECT, NOPUT
#use delay(clock = 4000000)
#use I2C(master, SDA=PIN_A5,  SCL=PIN_A4, fast=100000)

#define PB1 PIN_A1    // ENTER    (UP)
#define PB2 PIN_A2   // BACK      (DOWN)
#define PB3 PIN_A0   // NEXT      (ENTER)
#define BASE PIN_A3   // Select either TimeBased (Input Low) Or DistanceBased(Input High)
#define VALVE1 PIN_C0
#define VALVE2 PIN_C1
#define VALVE3 PIN_C2
#define VALVE4 PIN_C3

#define TRIGGER1 PIN_C7 
#define TRIGGER2 PIN_C6
#define TRIGGER3 PIN_C5
#define TRIGGER4 PIN_C4

#include <BMLCD420.c>

Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 11:35 am     Reply with quote

OK. So what you have done is put all the files into the project tab
'Source files'.

DONT.

_Only_ the primary file goes here. The rest must be in the 'header files'
tab.

Everything in the 'source files' tab, is compiled separately. Won't work.
Only the main program file should be here.
edbfmi1



Joined: 18 Jul 2006
Posts: 103

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 11:48 am     Reply with quote

Thanks for the reply Ttelmah,
We removed the 2 files from the Projects tab "Header Files" and it cleaned up a lot of the errors but now we are getting this when we compile it.

CLEAN SUCCESSFUL (total time: 10ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make -f nbproject/Makefile-default.mk dist/default/debug/BM44329.X.debug.cof
make[2]: *** No rule to make target 'X:/BeadMaster/24L16.c', needed by 'build/default/debug/_ext/70245343/24L16.o'. Stop.
make[1]: *** [nbproject/Makefile-default.mk:85: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2

BUILD FAILED (exit value 2, total time: 156ms)
edbfmi1



Joined: 18 Jul 2006
Posts: 103

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 12:08 pm     Reply with quote

Hi again, I just re-read your post Ttelmah,
We did have the 24L16.c and BMlcd420.c in the project "Header Files".
The only file we have in the "Source Files" is BM44329.c
So I am still confused as to why I am getting the compiler errors.

Thanks for the help.
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 3:07 pm     Reply with quote

curious.....

this line..

#include <24L16.c>

shouldn't it be after (below ) the
#use I2C(master, SDA=PIN_A5, SCL=PIN_A4, fast=100000)

? assuming the 24L16 is an I2C device and #use I2C is for it ??
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Jul 12, 2024 6:15 pm     Reply with quote

The typical order for a CCS program would be:

Code:
#include <16F1938.H>
#fuses XT, NOWDT, NOPROTECT, NOPUT
#use delay(clock = 4000000)
#use I2C(master, SDA=PIN_A5,  SCL=PIN_A4, fast=100000)
#include <24L16.c>
// other file includes go here
// Pin and other defines
// macros
......


This is not absolute but a general guide to program construction
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Sat Jul 13, 2024 6:05 am     Reply with quote

Remove the files from the header file section. I've seen problems from
other people before where MPLABX tries to incorrectly compile stuff from
here.
The fact that it is trying to export the compile for these files, says you have
MPLAB setup incorrectly somewhere. Go through the setup in the FAQ
page from CCS on this, and make sure your settings are as this shows.
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

PostPosted: Sat Jul 13, 2024 8:52 am     Reply with quote

MPLAB X require that you right click the file in the header and click on "exclude from file(s) from current configuration" otherwise it includes it automatically
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Sat Jul 13, 2024 9:11 am     Reply with quote

Good.
Thanks for that.
I knew I had seen people having issues if they were there before. I don't
have to do that, but I'm running on a Mac, so it is always just a little
different....
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