View previous topic :: View next topic |
Author |
Message |
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
Weird Compiler Errors |
Posted: Wed May 27, 2015 11:50 am |
|
|
I am getting a long list of compiler errors in CCS header files, so I must have done something stupid. It's just not obvious.
I'm using v5.046 PCWHD.
The project uses an 18F87J60, with Ethernet.
The first error is "This type can not be qualified with this qualifier", and the word "short" in the following line is underlined in red:
typedef signed short int INT16;
That line is from GenericTypeDefs.h. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 27, 2015 12:04 pm |
|
|
I think you're trying to compile Microchip files with the CCS compiler.
They're not compatible.
The file lists the supported compilers. CCS is not in the list:
Quote: |
Generic Type Definitions
********************************************
FileName: GenericTypeDefs.h
Dependencies: None
Processor: PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC, PIC32
Compiler: MPLAB C Compilers for PIC18, PIC24, dsPIC, & PIC32
Hi-Tech PICC PRO, Hi-Tech PICC18 PRO
Company: Microchip Technology Inc. |
|
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Wed May 27, 2015 12:11 pm |
|
|
Well, ya. The whole stack is from Microchip, with some mods made to work with CCS. Besides, it's the Project Wizard that selected the files to put in my project when I created it. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 27, 2015 1:25 pm |
|
|
You should say where the files come from in your first post.
I don't have the CCS IDE. I downloaded the CCS stack from a link
posted in an earlier thread. I used that code to analyze your problem.
Putting the typdefs into a small test program confirms the problem.
This program will not compile:
Code: |
#include <18F4620.h>
#fuses INTRC_IO, BROWNOUT, PUT, NOWDT
#use delay(clock=4M)
typedef signed int INT;
typedef signed char INT8;
typedef signed short int INT16;
typedef signed long int INT32;
//=======================================
void main()
{
while(TRUE);
}
|
But, there is a file, p18cxxx.h, that has the following lines in it
(amongst other things):
Code: |
// CCS PCH C Compiler to Microchip C18 Compiler compatability layer.
#case
#type signed
#type short=16 int=16 long=32
|
If I take those lines and stick them in the above program, then it compiles
with no errors.
Code: | #include <18F4620.h>
#fuses INTRC_IO, BROWNOUT, PUT, NOWDT
#use delay(clock=4M)
#case
#type signed
#type short=16 int=16 long=32
typedef signed int INT;
typedef signed char INT8;
typedef signed short int INT16;
typedef signed long int INT32;
//=======================================
void main()
{
while(TRUE);
}
|
This leads me to the conclusion that your stack is missing the p18cxxx.h
file or it's not #include'd. In the stack that I have, the following line is
in main.h:
Code: | #include "tcpip/p18cxxx.h" |
|
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Wed May 27, 2015 2:30 pm |
|
|
These are the include files the Project Wizard put in my file for Ethernet:
#include "tcpip/StackTsk2.h"
#include "tcpip/TCPIPConfig.h"
#include "tcpip/HardwareProfile.h"
#include "tcpip/p18cxxx.h"
If I move p18cxxx.h to be first, the errors in GenericTypeDefs.h go away, but there are still many others.
Next error is "Can not set this option this far into the code". This referring to this line in my header file:
#device *=16 ADC=16
My header file begins like this:
#include <18F87J60.h>
#include "tcpip/p18cxxx.h"
#device *=16 ADC=16
If I put p18cxxx.h back to where it was, I get the same error, but this time it's referring to a line in p18cxxx.h:
#device PASS_STRINGS=IN_RAM
According to the manual, "multiple #devices lines may be used to fully define the device." |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 27, 2015 2:48 pm |
|
|
I have to go out for a few hours. I can work on it later. Or if someone
else wants to help... |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed May 27, 2015 2:58 pm |
|
|
One thing I see right off is the #device *=16 line and other #device lines
need to be right after the processor line.... _________________ Google and Forum Search are some of your best tools!!!! |
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Wed May 27, 2015 4:47 pm |
|
|
I created a new 18F87J60 project using the Project Wizard with TCP/IP enabled. Then I compiled it as it, no changes made. I get a big list of compiler errors. Many of the errors are different than what I was getting on my real project. But shouldn't a skeleton project created by the Wizard compile? I also received a large number warnings.
Here's a few of the errors.
Warning: Undefined identifier TCPIP.h Line 138
Warning: Undefined identifier TCPIP.h Line 139
140
Undefined identifier STACK_USE_WIFI
Unknown Pragma (#pragma udata TCB_uRAM)(TCP.c)
Unknown Pragma (#pragma udata)
Error: Duplicate Interrupt Function (#INT_TIMER0)
All the interrupt handlers have error: Improper use of a function identifier
Every line of code in function StackPrintfChanges() has multiple errors.
Overall, 100 errors, 29 warnings.
Using v5.046 PCWHD. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 27, 2015 10:00 pm |
|
|
Quote: | Many of the errors are different than what I was getting on my real project. |
At this point, I suggest you call or email CCS support. They supply the
TCP/IP stack. Ask them for help on how to compile it. |
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Mon Jun 01, 2015 8:29 am |
|
|
I contacted tech support about this. The main problem is that the TCP/IP stack uses timer0 and I was also trying to use timer0 for the TICK feature. Once I switched to a different timer, most all the compiler errors went away.
The Project Wizard is going to be modified to not allow timer0 to be used if the TCP/IP feature is enabled.
It's also worth mentioning, that there are a large number (about 28) of compiler warnings that are produced when you use the TCP/IP stack, and I was told that this in normal. When using the Embedded Internet Development kit, you don't get those warnings, so seeing them in the real project made me think I was cause of them. |
|
|
|