Problem compiling C code "Errors"

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Werner
Posts: 95
Joined: Sat Jun 11, 2011 4:12 am
Has thanked: 87 times
Been thanked: 31 times

Problem compiling C code "Errors"

Post by Werner »

Hi Guys, Everything is working great in simulator however when I try to compile to my chip (16F877A) I am getting errors. This may be one for you Ben? The c file is below. I pulled up the C file in Visual Studio and found errors on lines 611,603,718,710,836,883 and there may be more? I think these errors are all related? This is what Flowcode is showing me:

F:\Wire Cutter\work5.c(631): error: missing semicolon
F:\Wire Cutter\work5.c(566): error: failure failure Return code = 1 Flowcode was unable to compile the flowchart's C code due to the following errors:

The line numbers that Flowcode gives me never seem to be correct? Is it because the Flowcode line numbers are without any blank lines? I was wondering about it?

As always any help is greatly appreciated!!

Werner
Attachments
work5.c
This is the flie with errors....
(48.76 KiB) Downloaded 227 times
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"

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: Problem compiling C code "Errors"

Post by medelec35 »

Hi Werner,
Werner wrote: F:\Wire Cutter\work5.c(631): error: missing semicolon
F:\Wire Cutter\work5.c(566): error: failure failure Return code = 1 Flowcode was unable to compile the flowchart's C code due to the following errors:
These numbers are vital for finding out whats causing the issue.
Download an editor like notepad++ (my personal favourite) which is free.
load the C code into it, then look at the fist error = line 631
You will see:
Keypad1.png
(4.51 KiB) Downloaded 1513 times
Notice there is no PORT letter shown after tris, it should say trisc or trisb depending on connections to keypad.
This would suggest that you have not set up the pin connections by right-clicking the Keypad and choosing connections.
The other line (566)
Is just showing the beginning of the function which caused the error:
Keypad2.png
(3.13 KiB) Downloaded 1513 times
So from that you can see it's the Keypad function.

I have also noticed that the c code was generated with Flowcode V4.3.
The latest update is flowcode 4.5 which has improved simulation and more microcontrollers added.

Tip: When you have installed your new editor, you can go into 'Chip', 'Compiler Options'
and use browse to set the path of the viewer up.
Then when you want to view the C code, just use Chip, View C then C can be seen on notepad++ or what ever you decide to use.

If you still get errors, then if you would like to post your flowchart, we can take a look at it for you

Martin
Martin

Werner
Posts: 95
Joined: Sat Jun 11, 2011 4:12 am
Has thanked: 87 times
Been thanked: 31 times

Re: Problem compiling C code "Errors"

Post by Werner »

Thanks again Martin! You got it! I did not have my pins setup correctly. I fixed it and I am up and running. I did download Notepad++ great tip very simple and works!
Thanks for everything!

Have a great day!

Werner
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"

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: Problem compiling C code "Errors"

Post by medelec35 »

Your welcome Werner & thanks.
Glad you have got your flowchart sorted.

There are other free notepad replacements like notepad2 and notepad itself can got a specified line number (see not forgotten Steve :P )
But another reason for using notepad++ is it can compare two files side by side and highlight any differences.

You have a great day too!

Martin
Martin

Werner
Posts: 95
Joined: Sat Jun 11, 2011 4:12 am
Has thanked: 87 times
Been thanked: 31 times

Re: Problem compiling C code "Errors"

Post by Werner »

Thanks for the tip Martin, I can already see that being able to compare two file could come in really handy!! I am going to try it out!
I will, I make every day a great day!

Werner
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"

Post Reply