integrating c code

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

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

integrating c code

Post by Ondra »

Good day all.
I have a project where I'm looking for expanded internet capabilities. Doing some research. I found on the source boost web site a program I would like to integrate in to my current project. I'm hoping someone could give me some direction on how I would go about including the files that make up this project into an existing flowcode project. The link includes a test file plus #includes to many other files. I downloaded the file and using source boost IDE I was able to compile the file. I would like to start by creating a blank flowcode file, load the IP test test file. Work out the issues to get the file working, then do the necessary coding to bring the two together.
Can any one give directions as to how I can go about getting the source files to compile and work with flowcode.

Ondra

http://www.dfzone.be/downloads/pic/PIC1 ... hernet.zip

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: integrating c code

Post by Benj »

Hello Ondra,

You should be able to use the Flowcode supplementary code window to add all the C includes, definitions and functions from the main C file.

Then any code in the main function simply add to your flowchart by using one or more C icons.

If you get stuck then post up your Flowcode file and I will see if I can provide any pointers of what to try next.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Thanks Ben.
In the main project file the there are listed some common #includes:
#include <system.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

Would these be already added by flowcode or should I include them as well?
Also should I just leave all the files in the unziped folder and use the fully qualified address in the #include or should I move all the files
to the project folder, or should I put the files in flowcode root folder?

Ondra

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: integrating c code

Post by Benj »

Hi Ondra,

I would include all the include files in the supplementary code. Flowcode will complain if it is including the same file twice so you will know what to remove.
Also should I just leave all the files in the unziped folder and use the fully qualified address in the #include or should I move all the files
to the project folder, or should I put the files in flowcode root folder?
Really it's up to you, I guess moving the files to the project directory keeps things clean but really no difference either way. If the files are not in the same directory as the Flowcode project files then you will have to supply the full path to the files in the include statement.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Thanks again.
I set up the program. tried to compiled cleared up the obvious.
Could you have a look see what I might be missing. A few errors I don't
understand.

Ondra
Attachments
IPtest.msg.txt
(2.66 KiB) Downloaded 295 times
IPtest.c
(11.74 KiB) Downloaded 248 times
IPtest.fcf
(19.49 KiB) Downloaded 259 times

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: integrating c code

Post by Benj »

Hello Ondra,

The errors you are receiving are down to a missing definition for TCPTest.

It looks like this is a global variable of some kind so you may just be missing a line of code such as this in the supplementary code definitions section.

char TCPTest;

or maybe

unsigned int TCPTest;

The example C file you have taken the code from should be defining TCPTest somehow. Try doing a search for the keyword.

Looking at the compiler messages. If you fix this small problem then hopefully the compilation will then be able to complete correctly. There is of course the chance that clearing this error will make room for more but I'll keep my fingers crossed for you :)

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Yes got that resolved. That cleared the way for a whole lot of errors:
Where should I begin with this?

Ondra

Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_set_netBIOSname(unsigned char*)'
Error: Unresolved external function:'network_set_netBIOSname(unsigned char*)'
Error: Unresolved external function:'HTTPInitServer(unsigned short)'
Error: Unresolved external function:'HTTPInitServer(unsigned short)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external function:'network_set_netBIOSname(unsigned char*)'
Error: Unresolved external function:'HTTPInitServer(unsigned short)'
Error: Unresolved external function:'UDPIsGetReady(unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'UDPIsPutReady(unsigned char)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPIsGetReady(unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'UDPIsPutReady(unsigned char)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPIsConnected(unsigned char)'
Error: Unresolved external function:'TCPIsGetReady(unsigned char)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPIsPutReady(unsigned char)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPFlush(unsigned char)'
Error: Unresolved external function:'TCPIsConnected(unsigned char)'
Error: Unresolved external function:'TCPIsGetReady(unsigned char)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPIsPutReady(unsigned char)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'
Error: Unresolved external function:'TCPFlush(unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_hex(unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_hex(unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_ip(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_int(unsigned short)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'sram_open(unsigned short,bit)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'serial_send_string(unsigned char*)'
Error: Unresolved external function:'HTTPTask(void)'
Error: Unresolved external symbol, function:HTTPTask
Error: Unresolved external function:'rtc_get_time(void)'
Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'ARPResolveBlock(?*,?*,unsigned long*)'

Error: Unresolved external symbol, function:ARPResolveBlock
Error: Unresolved external function:'UDPOpen(unsigned short,?*,unsigned short)'

Error: Unresolved external symbol, function:UDPOpen
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_ip(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_ip
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'TCPOpen(?*,unsigned char*,unsigned char,unsigned short)'
Error: Unresolved external symbol, function:TCPOpen
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'network_init(?*,?*)'
Error: Unresolved external symbol, function:network_init
Error: Unresolved external function:'network_set_netBIOSname(unsigned char*)'

Error: Unresolved external symbol, function:network_set_netBIOSname
Error: Unresolved external function:'network_in_configmode(void)'

Error: Unresolved external symbol, function:network_in_configmode
Error: Unresolved external function:'network_handle_tasks(void)'

Error: Unresolved external symbol, function:network_handle_tasks
Error: Unresolved external function:'HTTPInitServer(unsigned short)'

Error: Unresolved external symbol, function:HTTPInitServer
Error: Unresolved external function:'UDPIsGetReady(unsigned char)'
Error: Unresolved external symbol, function:UDPIsGetReady
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'UDPGetArray(unsigned char*,unsigned short)'

Error: Unresolved external symbol, function:UDPGetArray
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'

Error: Unresolved external symbol, function:serial_send_data
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'UDPDiscard(void)'

Error: Unresolved external symbol, function:UDPDiscard
Error: Unresolved external function:'UDPIsPutReady(unsigned char)'

Error: Unresolved external symbol, function:UDPIsPutReady
Error: Unresolved external function:'rtc_get_time(void)'

Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'UDPPutArray(unsigned char*,unsigned short)'

Error: Unresolved external symbol, function:UDPPutArray
Error: Unresolved external function:'UDPFlush(void)'

Error: Unresolved external symbol, function:UDPFlush
Error: Unresolved external function:'rtc_get_time(void)'

Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'TCPIsConnected(unsigned char)'
Error: Unresolved external symbol, function:TCPIsConnected
Error: Unresolved external function:'TCPIsGetReady(unsigned char)'

Error: Unresolved external symbol, function:TCPIsGetReady
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'

Error: Unresolved external symbol, function:TCPGetArray
Error: Unresolved external function:'TCPIsPutReady(unsigned char)'

Error: Unresolved external symbol, function:TCPIsPutReady
Error: Unresolved external function:'TCPPutArray(unsigned char,unsigned char*,unsigned short)'

Error: Unresolved external symbol, function:TCPPutArray
Error: Unresolved external function:'TCPGetArray(unsigned char,unsigned char*,unsigned short)'

Error: Unresolved external symbol, function:TCPGetArray
Error: Unresolved external function:'TCPFlush(unsigned char)'

Error: Unresolved external symbol, function:TCPFlush
Error: Unresolved external function:'rtc_init(void)'
Error: Unresolved external symbol, function:rtc_init
Error: Unresolved external function:'serial_init(void)'

Error: Unresolved external symbol, function:serial_init
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'spi_init(void)'

Error: Unresolved external symbol, function:spi_init
Error: Unresolved external function:'sram_init(void)'

Error: Unresolved external symbol, function:sram_init
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'sram_write(unsigned short,unsigned char*,unsigned char)'

Error: Unresolved external symbol, function:sram_write
Error: Unresolved external function:'sram_read(unsigned short,unsigned char*,unsigned char)'

Error: Unresolved external symbol, function:sram_read
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_hex(unsigned char)'

Error: Unresolved external symbol, function:serial_send_hex
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'rtc_get_time(void)'

Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'DNSResolveBlock(unsigned char*,unsigned char,?*,unsigned long*)'

Error: Unresolved external symbol, function:DNSResolveBlock
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_ip(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_ip
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'HTTPDownloadFile(unsigned char*,unsigned char*,?*)'

Error: Unresolved external symbol, function:HTTPDownloadFile
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_int(unsigned short)'

Error: Unresolved external symbol, function:serial_send_int
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_int(unsigned short)'

Error: Unresolved external symbol, function:serial_send_int
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'serial_send_int(unsigned short)'

Error: Unresolved external symbol, function:serial_send_int
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'sram_open(unsigned short,bit)'

Error: Unresolved external symbol, function:sram_open
Error: Unresolved external function:'sram_read_byte(void)'

Error: Unresolved external symbol, function:sram_read_byte
Error: Unresolved external function:'serial_send_data(unsigned char*,unsigned char)'

Error: Unresolved external symbol, function:serial_send_data
Error: Unresolved external function:'sram_close(void)'

Error: Unresolved external symbol, function:sram_close
Error: Unresolved external function:'sram_pop(unsigned char*,unsigned char)'

Error: Unresolved external symbol, function:sram_pop
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string
Error: Unresolved external function:'rtc_get_time(void)'

Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'rtc_get_time(void)'

Error: Unresolved external symbol, function:rtc_get_time
Error: Unresolved external function:'MACIsLinked(void)'

Error: Unresolved external symbol, function:MACIsLinked
Error: Unresolved external function:'network_handle_tasks(void)'

Error: Unresolved external symbol, function:network_handle_tasks
Error: Unresolved external function:'serial_send_string(unsigned char*)'

Error: Unresolved external symbol, function:serial_send_string

.



failure
Return code = -2

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: integrating c code

Post by kersing »

The ZIP file contains a number of files that provide the functionality needed by the main program. There are errors because the functions defined in the additional files are not being found in your code. You need to find some way to include the contents of those files in your application.
One way you could try (no guarantee it will work) is to include all the required files with include statements.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Good day Ben if your in today.
Could you provide any further in-site it to this issue?

Ondra

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: integrating c code

Post by Benj »

Hello Ondra,

Yes it looks like some of the required functions are not being included correctly.

Are you including the external files like this in the defines section of the supplementary code window.

include "c:\pathtofile\file.h"
include "c:\pathtofile\file.c"

If you are already doing this then maybe the paths are incorrect or need checking.

If the includes are all correct and the functions should be present then as a last resort you can try to force Flowcode to recognise the functions by adding extern function prototypes to the end of the defines section of the supp code window.

eg

extern ARPResolveBlock(?*,?*,unsigned long*);
extern UDPOpen(unsigned short,?*,unsigned short);
etc...

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Hi Ben when you say external files. If all the IP files are in the same folder as the flowcode project file, do I need to add the full address to the include?

Ondra

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: integrating c code

Post by Benj »

Hi Ondra,

You shouldn't need to use the full path if the files are in the same folder. Maybe try using the full path for one include and see if this gets rid of any of the errors from the compilation window. Then maybe try one of the extern functions and seeing if this gets rid of any errors. I seem to remember having to rely on using extern for some of the v5 code abstraction bits and pieces.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Good day Ben.

I made the changes you suggested. I'm getting the same results. When I use extern I get a different error : function with the same name "'serial_send_string' but different return type already exists." I have uploaded the flowcode file and included the .c file. Just in case it can assist in solving the issue.
For the record the file does compile using the standalone Sourceboost IDE.

Ondra
Attachments
IPtest.c
(12.5 KiB) Downloaded 199 times
IPtest.fcf
(20.79 KiB) Downloaded 190 times

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: integrating c code

Post by Benj »

Hello Ondra,

In the C files you are including there should be some functions. You need to find the start line of each function and copy it exactly. The extern examples I gave you were taken from the compiler error window so they might not be 100% correct and would explain the new errors you are getting.

here is a basic example function.

char ben1 (char a, unsigned int b)
{
function code
}

to make the extern prototype simply copy the line containing the function name and parameters and add extern to the beginning and a semi colon to the end.

extern char ben1 (char a, unsigned int b);

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Thanks for you help Ben.
I selected a few of the common errors like this one listed below: -
Error: Unresolved external function:'serial_send_string(unsigned char*)'


Updated the "Definitions and function declarations" with the extern:-
extern void serial_send_string(unsigned char * data); // this is the correct declaration

The below error still showing up.
Error: Unresolved external function:'serial_send_string(unsigned char*)'

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: integrating c code

Post by Benj »

Hello Ondra,

Right it certainly sounds like the function cannot be found by the compiler even with the extern prototype. Have you tried changing the include line in the supp code window to use the full file path of the file. Also make sure that the include statements are above any of the code that references the functions.

If your still in doubt then can you post up the FCF file and some of the problematic include files and maybe I can spot something wrong somewhere?

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Good day Ben.
I've come full cycle back to this code implementation. I have worked through most of the errors. I'm now stuck on this 1
error:- "IPtest.c(323:6): error: Function 'interrupt' already has a body".
I understand the problem, but in this instance I can't find two instances of the function. Please see attachment.

void MX_INTERRUPT_MACRO(void)
{
}
Attachments
IPtest.c
(8.35 KiB) Downloaded 157 times
IPtest.fcf
(12.69 KiB) Downloaded 155 times

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: integrating c code

Post by Benj »

Hello Ondra,

I get an error about missing include files when I try and compile the program. My guess is that the interrupt handler is already included as part of the included files and this is what is causing your error.

The interrupt function is added as part of the

Code: Select all

 section of the FCD file so you should be able to edit the FCD to remove the interrupt function from the end of the output C file.

IntStart="void MX_INTERRUPT_MACRO(void)\n{\n"
IntEnd="}\n\n"

Simply change to 

IntStart=""
IntEnd=""

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Thanks Ben.
To add to that. The example is me trying to get the code compiling and working before I add it to another project I'm working on.
In my existing project I am using interrupt timer0. By disabling interrupts in the FCD file will my interrupt still work?

Ondra

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: integrating c code

Post by Benj »

Hi Ondra,

Right for standard 8-bit PICs there is generally two interrupt vectors, a high priority and a low priority. I think we always take the low priority interrupt function and put all the interrupt handler code in here. This is the function you can see at the end of the Flowcode C file.

If this function already exists in one of your include files then you need to move the code from the C file into Flowcode (tricky to do without editing the FCD or using the interrupt function of a custom component) or you can move the code from Flowcode into the C file (might be slightly easier).

Alternatively you can use the high priority interrupt function for one or the other but I'm not sure all 8-bit PICs have this and you need to start messing about in registers to enable interrupts as high priority. I probably wouldn't advise this approach unless you need one interrupt type to overpower another already running interrupt macro etc.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Thanks again Ben.
First step getting the code to compile. Using your recommendation to alter the FCD file. I got past the error:- "IPtest.c(323:6): error: Function 'interrupt' already has a body". I now have a list of new error I can't seem to resolve using some of your earlier recommendations. Any other recommendations on this? Again thanks in advance.

IPtest.c(189:2): error: unknown identifier 'UDPTest'
IPtest.c(189:2): error: invalid operand 'UDPTest'
IPtest.c(189:9): error: failed to generate expression
IPtest.c(191:2): error: unknown identifier 'UDPTest'
IPtest.c(191:2): error: invalid operand 'UDPTest'
IPtest.c(191:10): error: failed to generate expression
IPtest.c(205:2): error: unknown identifier 'TCPTest'
IPtest.c(205:2): error: invalid operand 'TCPTest'
IPtest.c(205:10): error: failed to generate expression
IPtest.c(206:6): error: unknown identifier 'TCPTest'
IPtest.c(206:6): error: invalid operand 'TCPTest'
IPtest.c(206:13): error: failed to generate expression
IPtest.c(261:6): error: unknown identifier 'TCPTest'
IPtest.c(261:6): error: invalid operand 'TCPTest'
IPtest.c(261:13): error: failed to generate expression
IPtest.c(261:40): error: unknown identifier 'TCPTest'
IPtest.c(261:39): error: arguments of 'TCPIsConnected' don't match the parameters of call
IPtest.c(261:25): error: failed to generate expression
IPtest.c(261:13): error: invalid operand '!='
IPtest.c(261:25): error: invalid operand 'TCPIsConnected(TCPTest)'
IPtest.c(261:22): error: failed to generate expression
IPtest.c(276:6): error: unknown identifier 'UDPTest'
IPtest.c(276:6): error: invalid operand 'UDPTest'
IPtest.c(276:13): error: failed to generate expression

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Good day Ben.
Here is the latest update. I feel I've moved the goal post so many times and still can't get the ball in.
I went through the process of including all the projects .c and .h as #include files in the supplementary window.
After all this, here is the last. I'm stuck again. Maybe this narrows it down. It would be nice to have this working
for the weekend. Thanks.

Ondra


stack\DNS.c(78:22): error: variable 'Flags' already exists and has different data type
stack\DNS.c(190:14): error: failed to generate expression
stack\DNS.c(193): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(193:11): error: failed to generate expression
stack\DNS.c(225): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(225:11): error: failed to generate expression
stack\DNS.c(227:18): error: failed to generate expression
stack\DNS.c(227:2): error: error in expression
stack\DNS.c(227:2): error: failed to generate expression
stack\DNS.c(263): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(263:11): error: failed to generate expression
stack\DNS.c(269): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(269:11): error: failed to generate expression
stack\DNS.c(466): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(466:11): error: failed to generate expression
stack\DNS.c(498): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(498:11): error: failed to generate expression
stack\DNS.c(530): error: can't convert constant to 'struct <*unnamed*>'
stack\DNS.c(530:11): error: failed to generate expression
stack\DNS.c(554:15): error: failed to generate expression

..............................

IPtest.c success

failure
Return code = 1
Attachments
IPtest.c
(8.98 KiB) Downloaded 185 times
IPtest.fcf
(14.03 KiB) Downloaded 150 times

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: integrating c code

Post by Benj »

Hello,

All the errors are being reported from the "stack\DNS.c" file and not your Flowcode project C file. Can you attach this file too?

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

Here it is.
Attachments
DNS.h
(2.89 KiB) Downloaded 162 times
DNS.c
(23.58 KiB) Downloaded 131 times

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: integrating c code

Post by Ondra »

I have to slip out for about an hour. Here is the complete project file.
If you need anything else it should be in there.
Just discovered it's too big. The link to the main IP project file is above, and you do have my project file.

Ondra

Post Reply