Compilation error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Compilation error

Post by Sefi »

Hello everyone,

I get a compilation error on the attached custom component. The interesting thing is that if I exclude the last macro by setting the Macronames, Count to 14 it works but including the last macro (TFT_Char) I get the following error:
Flowcode1.c(460): error: missing right paren
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: unexpected constant
Flowcode1.c(460): error: variable name expected
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: variable name expected
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: variable name expected
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: variable name expected
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: variable name expected
Flowcode1.c(460): error: general error
Flowcode1.c(460): error: failure
although it is unlikely that the code will win any awards for anything ;-), I cant see what is wrong, as the error message seems misleading and is probably connected to some other issue.

any help would be greatly appreciated.

many thanks
Sefi
Attachments
FC5_PIC_Custom2.c
(34.97 KiB) Downloaded 261 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Compilation error

Post by JonnyW »

Hello. Your error is in Flowcode1.c, not FC5_PIC_Custom2.c. Could you post this file so we can see what line the error is on?

One thing I do notice in your custom code is that you have an array of 784 elements. The PIC only supports arrays of 256 bytes or less - the size of one page of memory. You may need to break this up into multiple sub-arrays to get this working.

Cheers,

Jonny

Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Re: Compilation error

Post by Sefi »

Thanks Jonny,

many thanks for taking a look at this.

Sefi
Attachments
Flowcode1.fcf
(18.14 KiB) Downloaded 254 times

Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Re: Compilation error

Post by Sefi »

I have now split the array holding the bitmap definitions of the characters into 3 separate arrays of 256 bytes each. There is a restriction by the compiler which says you cant have arrays bigger than 256 bytes and "apparently" this can be overcome by adding the following directive to the compiler parameter line "-idx 2". I have tried this and maybe I am doing something wrong but I couldnt get it to work.

I have attached the changed custom component file here and still get the same error.

many thanks
Sefi
Attachments
FC5_PIC_Custom2.c
(18.94 KiB) Downloaded 246 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Compilation error

Post by JonnyW »

Hi. No problems. In the directory where Flowcode1.fcf is there is a generated C file called Flowcode1.c. Can you post this C file (not the FCF)?

From the error it looks like you have a missing semi-colon or end bracket somewhere in your code. By posting the Flowcode1.c file we will be able to see what the compiler doesn't like on line 490.

Cheers,

Jonny

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Compilation error

Post by medelec35 »

I would like to add to Jonnys post that missing semicolon can also be caused by a component not connected to pin when it should be.

For intance when a Keypad component on the control panel is showing unconnected instead of port B1 for any of its connections.

Martin
Martin

Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Re: Compilation error

Post by Sefi »

Thanks Jonny and Martin,

I have attached the C file for your perusal.

Thank you for taking the time to look at it.
Attachments
Flowcode1.c
(22.43 KiB) Downloaded 302 times

Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Re: Compilation error

Post by Sefi »

Jonny,

the error is on line 371 which is the last of the Macro Functions declarations. The interesting thing is that if I exclude the last subroutine TFT_Char by setting the macro numbers to 14 in the custom components file, then it all works and the LCD functions correctly. There must be some issue with the last subroutine which I cant see.

thank you
Sefi

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Compilation error

Post by JonnyW »

Hello. I believe BoostC defines 'C' - probably as nothing to indicate a C compiler (C++ compilers use this sometimes). You are using C as the first argument of your function.

You could either add the line '#undef C' somewhere above your prototype or (probably better) use a different name than 'C'. This should fix your code.

Cheers,

Jonny

Sefi
Posts: 56
Joined: Mon Sep 29, 2008 10:26 am
Has thanked: 9 times
Been thanked: 14 times

Re: Compilation error

Post by Sefi »

Jonny,

A huge thank you. Absolutely brilliant. That fixed it. :-)

Sefi

Post Reply