UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,551 Views
Registered: ‎08-26-2014

Zynq project doesn't compile when changing from Debug to Release configuration

Jump to solution

Hello,

 

I have a project that works without any problem when Debug configuration is selected. Now, I want to go to the Release version to improve computation time but it does not compile. Apparently, it cannot find the math.h library. Very weird.

 

Here the console output where fmod and sin are two functions from the math library:

 

 

[...]
'Finished building: ../src/test_synchro_main.c' 'Building target: test_synchro.elf' 'Invoking: ARM v7 gcc linker' arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none -specs=Xilinx.spec -Wl,-T -Wl,../src/lscript.ld -L../../test_synchro_bsp/ps7_cortexa9_0/lib -o "test_synchro.elf" ./src/ABC_alpha_beta_zero.o ./src/ABC_dq0.o ./src/Full_DFIG.o ./src/Integrateur.o ./src/Integrateur_vitesse.o ./src/RC.o ./src/RL_load.o ./src/alpha_beta_zero_ABC.o ./src/correcteur_PI.o ./src/dq0_ABC.o ./src/sintab.o ./src/sinus_angle.o ./src/test_synchro_main.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group ./src/Full_DFIG.o: In function `Full_DFIG_proc': Full_DFIG.c:(.text+0x14c): undefined reference to `fmod' Full_DFIG.c:(.text+0x1b0): undefined reference to `sin'
[...]

 

Does anyone have a clue about what is going on?

 

Thanks,

 

Cerilet

 

0 Kudos
1 Solution

Accepted Solutions
Voyager
Voyager
4,724 Views
Registered: ‎04-13-2015

Re: Zynq project doesn't compile when changing from Debug to Release configuration

Jump to solution

The exact error message is it soed not find these 2 function.

This is because the math library (libm.a) is not included in the linker command:

 

-Wl,--start-group,-lxil,-lgcc,-lc,--end-group

You need to add -lm

All there is to do is to go into SDK linker setting for your project and in the "library" window, add "m".

 

Regards

 

0 Kudos
2 Replies
Voyager
Voyager
4,725 Views
Registered: ‎04-13-2015

Re: Zynq project doesn't compile when changing from Debug to Release configuration

Jump to solution

The exact error message is it soed not find these 2 function.

This is because the math library (libm.a) is not included in the linker command:

 

-Wl,--start-group,-lxil,-lgcc,-lc,--end-group

You need to add -lm

All there is to do is to go into SDK linker setting for your project and in the "library" window, add "m".

 

Regards

 

0 Kudos
Explorer
Explorer
2,510 Views
Registered: ‎08-26-2014

Re: Zynq project doesn't compile when changing from Debug to Release configuration

Jump to solution

That was it.

 

Thanks @ericv!

0 Kudos