undefined reference error

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

undefined reference error

Post by stefan.erni »

Hi Ben

Strange Problem.
I insert some C-Code. sometimes it's working, somtimes not. I don't now what is wrong in the few commands.
Is there something I'm doing wrong?

/*
Enter C code below this comment
*/
FCD_0e742_PWDN_ADS__TurnOn();
// Call Component Macro: RESET_ADS::TurnOn()
FCD_0e743_RESET_ADS__TurnOn();
// Delay: 500 ms
FCI_DELAYINT_MS(500);
// Call Component Macro: CS_ADS::TurnOff()
FCD_0e743_RESET_ADS__TurnOff();
// Call Component Macro: SPI_ADS99::SendChar(.wakeup)
FCD_06c41_SPI_ADS99__SendChar(FCL_WAKEUP);





C:\C#SOUR~1\_#FC\EMG5er\Flowcode_Emg_5er_main1.o(.text+0x590):C:\C#SOUR~1\_#FC\EMG5er\Flowcode_Emg_5er_main1.c: undefined reference to `FCD_06c41_SPI_ADS99__SendChar'

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: undefined reference error

Post by Benj »

Hello,

The problem is likely the function prefixes.

e.g.
FCD_0e742_
FCD_0e743_

Flowcode creates these so they are unique and so you can have multiple of the same component in your project without them causing problems with each other.

Check that these prefixes are correct in the projects that are not compiling and that should solve the problem for you.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: undefined reference error

Post by stefan.erni »

Hi Ben

I have to import a lot of c code and change it to FC7 conform.
It's mostly sending a constants or variables to the spi_out.
the constants I creat it one by one and ad the hex Value......
But can I use C code with copy/paste for sending like
FCD_06c41_SPI_ADS99__SendChar(FCL_WAKEUP);
FCD_06c41_SPI_ADS99__SendChar(FCL_CH1SET);
Constants.PNG
(11.26 KiB) Downloaded 2050 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: undefined reference error

Post by LeighM »

Hi,
You are best calling Flowcode macros from an icon, but if you want to cut'n'paste lines, as in C, then you can put the calls into a calculation icon...
calc_box.jpg
calc_box.jpg (40.65 KiB) Viewed 4424 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: undefined reference error

Post by stefan.erni »

Hi Leigh

Perfect. "put the calls into a calculation Icon"
That what I'm looking for. It's working
The calculation Icon I use anyway. So my Flowcode now is very comfortable to use and read....

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: undefined reference error

Post by stefan.erni »

Hi Leigh
Thank you for the additional infos. Just for an info. More or less the same code.
Compare the first Pictures with all with Icon's and the second Pictures with variables and constants and the call's in calculation Icon.
That's really nice in Flowcode.
b4.PNG
(45.99 KiB) Downloaded 2044 times
b4_a.PNG
(9.77 KiB) Downloaded 2044 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: undefined reference error

Post by LeighM »

You might also like to know that you can drag and drop component functions (macros) into the calculation box in the same way that you can with variables..
calc_drag_drop.jpg
calc_drag_drop.jpg (52.12 KiB) Viewed 4414 times

Post Reply