HiTech C error: system.h not found

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
chicoDaMan
Posts: 10
Joined: Sun Apr 24, 2016 1:18 am
Has thanked: 2 times
Been thanked: 4 times

HiTech C error: system.h not found

Post by chicoDaMan »

Hi - New Flowcode 6 user here...I'm getting things set up to use the High Tech C compiler.

I used the instructions in the WIKI (http://www.matrixtsl.com/wiki/index.php ... (PICmicro)).

But when I try to compile I get the error:

Code: Select all

Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe  --CHIP=12F683 -N48 Ranger_Timer+12v_v6.c
C:\Program Files\Flowcode 6\CAL\internals.c:
    63:	  #include <system.h>
	                    ^ (141) can't open include file "system.h": No such file or directory
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode)  V9.83
Copyright (C) 2011 Microchip Technology Inc.
Serial number: HCPICP-654321 (PRO)
(908) exit status = 1

C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe reported error code 1

I imported this Flowcode source file from a friend who's a Flowcode 5 user. He sent me his v5 .c output file and it compiles ok with HTC in MPLAB on my machine. I sent him my v6 output file and he gets the same error on his HTC/MPLAB setup.

I couldn't find any reference to this issue in the forums...am I overlooking something?

Thanks...

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: HiTech C error: system.h not found

Post by Rudi »

EDIT:
for interest only..
do you installed the compiler as PRO or as LITE version?
chicoDaMan wrote:

Code: Select all

Launching the compiler...
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode)  V9.83
Copyright (C) 2011 Microchip Technology Inc.
Serial number: HCPICP-654321 (PRO)
(908) exit status = 1
C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe reported error code 1
..I imported this Flowcode source file from a friend ...

your License 6 5 4 3 2 1 point to a LITE too :)

Code: Select all

HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.70
Copyright © 2009 Microchip Technology Inc.
Serial number: HCPICP-654321 (PRO) 
mhm..


chicoDaMan wrote:......I'm getting things set up to use the High Tech C compiler.
I used the instructions in the WIKI (http://www.matrixtsl.com/wiki/index.php ... (PICmicro)).
hi
thank you for link to wiki Hightec c compiler options i had searched this.
btw have edit your link

have a look into your HighTec C folder where libs and include are.
"C:\Program Files\HI-TECH Software\PICC\9.83\"
check / look up if system.h is in your include folder or missing

second,
run cmd ( shell ) from Start

Code: Select all


type in
c:\users\yourname\echo %path%
example
check that
"C:\Program Files\HI-TECH Software\PICC\9.83\bin"
is in your path
perhabs it helps

best wishes
rudi ;-)

info2

chicoDaMan
Posts: 10
Joined: Sun Apr 24, 2016 1:18 am
Has thanked: 2 times
Been thanked: 4 times

Re: HiTech C error: system.h not found

Post by chicoDaMan »

Rudi wrote:EDIT:
for interest only..
do you installed the compiler as PRO or as LITE version?
PRO version. I've been using this compiler for years. I've masked the serial number, for obvious reasons...
Rudi wrote:have a look into your HighTec C folder where libs and include are.
"C:\Program Files\HI-TECH Software\PICC\9.83\"
check / look up if system.h is in your include folder or missing
Thanks for the suggestion, but there is no "system.h" file in the Hi-Tech folders. There is a "sys.h", but that's not called by the Flowcode output.

The Flowcode V5 output for the Hi-Tech compiler does NOT include "system.h", it includes "pic.h". The Flowcode version 5 output contains this:

Code: Select all

//Functions
#define MX_CLK_SPEED 4000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif


On the other hand, the Flowcode version 6 output .c file includes "internals.h":

Code: Select all

/#define MX_PIC

/*========================================================================*\
   Use :Include the type definitions
\*========================================================================*/
#include "C:\Program Files\Flowcode 6\CAL\internals.c"

...which in turn includes "system.h":

Code: Select all

#ifdef MX_PIC
  #include <system.h>
#endif
Flowcode version 5 clearly avoids including "system.h" but Flowcode version 6 does include it.

So....is it possible that Flowcode 6 is mistakenly including "system.h" when configured for the Hi-Tech compiler?

I'd dig in and start modifying the Flowcode "internals.c" file, but I just purchased Flowcode and hesitate to start mucking around under the hood until I understand it better.

Has anyone encountered this issue before?

Thanks...chico

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: HiTech C error: system.h not found

Post by Rudi »

hi

not sure is this the end solution for yours.
in HITECH include folder:
- copy sys.h to system.h
now you have 2 same files with same defines

take this to the HITECH include file too, you will be missing this in next steps.

if your chip is not supported you can try this too

not sure that all steps will help you 100 procent, ( first step can it be there is a mistake but not sure - try it like i posted ) but this are the things i found if i use the search funktion in forum :mrgreen:

best wishes
rudi ;-)

chicoDaMan
Posts: 10
Joined: Sun Apr 24, 2016 1:18 am
Has thanked: 2 times
Been thanked: 4 times

Re: HiTech C error: system.h not found

Post by chicoDaMan »

Hi Rudi - Thanks for the response. I've been struggling with this since I purchased Flowcode a few weeks back. I want to get past compiler issues and into the fun parts!
Rudi wrote: not sure is this the end solution for yours.
in HITECH include folder:
- copy sys.h to system.h
now you have 2 same files with same defines
OK...it doesn't give me the "can't find" message anymore...
Rudi wrote:take this to the HITECH include file too, you will be missing this in next steps.
OK. I put it into the FLOWCODE 6\CAL folder...please advise if this is not the correct location.
Rudi wrote: not sure that all steps will help you 100 procent, ( first step can it be there is a mistake but not sure - try it like i posted ) but this are the things i found if i use the search funktion in forum :mrgreen:
I've been using the forum search function a lot, have learned a lot...but haven't yet found out if anybody is successfully using the HiTech compiler with Flowcode 6. But the WiKi instructions would indicate so, even though I haven't gotten it to work yet.

Here's the Flowcode error output for one of the sample files. I wonder if anyone can see what I'm doing wrong:

Code: Select all

Target folder: C:\MPLABP~1\12F683~3\12F683~2\FC6_TEST\hitech
Source name:   C:\MPLAB Projects\12F683 Projects\12F683 Ranger_Battery_Timer\FC6_TEST\hitech\FC6_TEST_PROJECT_hitech.fcfx
Title:         
Description:   This blank project consists of an LCD display and 2xADC inputs, configured to be ready for use with a PIC16F877A
Device:        PIC.16F.16F877A
Generated by:  Flowcode v6.1.3.2
Date:          Thursday, April 28, 2016 17:25:59
Users:         1
Registered to: xxxxx
Licence key:   yyyyy
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe  --CHIP=16F877A -N48 FC6_TEST_PROJECT_hitech.c
FC6_TEST_PROJECT_hitech.c: __CONFIG()
    30:	__CONFIG(0x3F72);
	         ^ (194) ")" expected
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_IO.c:
   125:	inline MX_UINT8 FC_CAL_Port_In_DDR__x (MX_UINT8* Port, MX_UINT8* Tris, MX_UINT8 InMask, MX_UINT8 Shift)
	       ^ (374) missing basic type; int assumed (warning)
	       ^ (372) "," expected
	                ^ (983) storage class redeclared for "MX_UINT8" (warning)
	                ^ (1098) conflicting declarations for variable "MX_UINT8" (C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_TypeDefs.c:44)
	                ^ (372) "," expected
   126:	{
	^ (984) type redeclared
	^ (1098) conflicting declarations for variable "FC_CAL_Port_In_DDR__x" (C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_IO.h:74)
	^ (314) ";" expected
   128:	return (*Port & InMask) >> Shift;
	^ (285) no identifier in declaration
	^ (374) missing basic type; int assumed (warning)
	^ (314) ";" expected
   129:	}
	^ (285) no identifier in declaration
	^ (374) missing basic type; int assumed (warning)
	^ (314) ";" expected
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c:
    40:	float pow(float x, float y);
	     (984) type redeclared ^
	                           ^ (1098) conflicting declarations for variable "pow" (C:\PROGRA~1\HI-TEC~1\PICC\9.83\include\math.h:18)
   122:	{
	^ (984) type redeclared
	^ (1098) conflicting declarations for variable "pow" (C:\PROGRA~1\HI-TEC~1\PICC\9.83\include\math.h:18)
	^ (252) argument 0 conflicts with prototype
   183:	inline signed long flt_cos_i(unsigned long Rads12)
	       ^ (374) missing basic type; int assumed (warning)
	       ^ (314) ";" expected
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c: flt_cos_i()
   215:	return ((signed)((2949120L - x2 + x4 - x6 + x8 - err) * sgn) * 7) >> 1;
	               ^ (374) missing basic type; int assumed (warning)
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c:
   230:	inline signed long flt_sin_i(unsigned long Rads12)
	       ^ (374) missing basic type; int assumed (warning)
	       ^ (314) ";" expected
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c: flt_sin_i()
   260:	return (signed)(x - x3 + x5 - x7 + x9 + err) * sgn;
	              ^ (374) missing basic type; int assumed (warning)
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c: flt_atan()
   284:	if ((signed)x < 0)
	           ^ (374) missing basic type; int assumed (warning)
   286:	x = -(signed)x;
	            ^ (374) missing basic type; int assumed (warning)
   310:	x = (signed)(x - x3 + x5 - x7 + x9 - err) * sgn;
	           ^ (374) missing basic type; int assumed (warning)
   311:	Ratio = ((float)((signed)x));
	                        ^ (374) missing basic type; int assumed (warning)
   338:	Ratio = ((float)((signed)x));
	                        ^ (374) missing basic type; int assumed (warning)
   348:	Ratio = ((float)((signed)x));
	                        ^ (374) missing basic type; int assumed (warning)
   352:	return 0.0;
	^ (345) unreachable code (warning)
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c:
   365:	{
	^ (984) type redeclared
	^ (1098) conflicting declarations for variable "cos" (C:\PROGRA~1\HI-TEC~1\PICC\9.83\include\math.h:10)
	^ (252) argument 0 conflicts with prototype
C:\Program Files\Flowcode 6\CAL\PIC\PIC_CAL_Float.c: 365: too many errors (21)
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode)  V9.83
Copyright (C) 2011 Microchip Technology Inc.
(908) exit status = 1
.
C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe reported error code 1


FINISHED
Compiler problems always make my head swim...is there something obvious that's causing the errors above?

Thanks....

Post Reply