LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

cross-compile generated C code

Hello,
I'm trying to cross-compile the C code generated from the uC SDK, but I'm getting undefined reference errors from the compiler.
I'm using an ARM7 based embedded board with uCLinux and buildroot as cross compiler. I was able to cross compile the labview runtime library by adapting the makefile from the m5329evb example so far. But now when I try to cross compile the c code of my VI the compiler gives undefined reference errors.
My question is, how do I make the the compiler use the built library and which parameters do I have to use?
Here is command I used to compile my VI:
~/buildroot/buildroot-atmel/toolchain_build_arm_small/gcc-4.1.2-final/gcc/gcc-cross vi1.c -I/home/michael/buildroot/CCodeGen/include/blockdiagram/ -I/home/michael/buildroot/CCodeGen/include/frontpanel/ -I/home/michael/buildroot/CCodeGen/include/comms/ -I/home/michael/buildroot/CCodeGen/include/os/unix -I/home/michael/test/CcodeGen/ -L/home/michael/buildroot/CCodeGen/libsrc/main/ -L/home/michael/buildroot/CCodeGen/libsrc/blockdiagram/ -L/home/michael/buildroot/CCodeGen/libsrc/os/unix /home/michael/test2/libs/rt.a -DCHeadless -DUnix -w -o vi1

Michael

0 Kudos
Message 1 of 5
(8,551 Views)
I figured out that in the generated c code no main function was defined and the lvEmbeddedMain.c wasn't generated too.
In which file can I find the main function?

Michael
0 Kudos
Message 2 of 5
(8,543 Views)
Hi Michael,

lvEmbeddedMain.c is not a generated file. It is located in labview\CCodeGen\libsrc\main\lvEmbeddedMain.c. It is copied to the build folder in the labview\Targets\NI\Embedded\unix\unix_LEP_TargetPlugin\LEP_unix_CopySupportFiles.vi plug-in VI.

What symbols are undefined?
--
Michael P
National Instruments
0 Kudos
Message 3 of 5
(8,539 Views)
Thanks. I copied the lvEmbeddedMain to my project directory and modified the makefile to make the gcc link the needed files and libraries explicitly. Now the project is beeing compiled without an error.

Michael.
Message 4 of 5
(8,526 Views)

Does it work as expected? Will it work for any ARM based SBC?

0 Kudos
Message 5 of 5
(2,668 Views)