Andes Workshop
http://forum.andestech.com/

Error message when compile C extension program
http://forum.andestech.com/viewtopic.php?f=23&t=770
Page 1 of 1

Author:  cindy [ Tue Dec 24, 2013 5:40 pm ]
Post subject:  Error message when compile C extension program

If we get an error message when compiling C extension program, like the following message:
Code:
./src/interrupt-c-ext.o:(.rodata+0x4): undefined reference to `_nds32_vector_01'
./src/interrupt-c-ext.o:(.rodata+0x8): undefined reference to `_nds32_vector_02'
./src/interrupt-c-ext.o:(.rodata+0xc): undefined reference to `_nds32_vector_03'
./src/interrupt-c-ext.o:(.rodata+0x10): undefined reference to `_nds32_vector_04'
......
./src/interrupt-c-ext.o: In function `_nds32_vector_00':
(.nds32_vector.00+0x0): undefined reference to `_nds32_reset'
./src/interrupt-c-ext.o: In function `_nds32_vector_09':
(.nds32_vector.09+0xa): undefined reference to `_nds32_i_ps_nn'
./src/interrupt-c-ext.o: In function `_nds32_vector_10':
(.nds32_vector.10+0xa): undefined reference to `_nds32_i_ps_nr'
./src/interrupt-c-ext.o: In function `_nds32_vector_15':
......


We should add a library to solve this problem.
nds32le-elf-gcc -O0 -nostartfiles -static -T"../nds32-c-ext.ld" -o "demo-int-c-ext.adx" ./src/init-default.o ./src/init-soc.o ./src/interrupt-c-ext.o ./src/main-c-ext.o ./src/uart.o -lnds32_isr
Finished building target: demo-int-c-ext.adx

In AndeSight, we can add the option in ld setting.
Attachment:
1.gif
1.gif [ 18.24 KiB | Viewed 6409 times ]

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/