Linker error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Linker error

1,440 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OXO on Sun Jul 24 08:23:08 MST 2011
Hi,

I expect I am being a bit dim, but it's sunday and I'm tired..

Can anyone tell me what's causing these linker errors?

c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x12): undefined reference to `_sbrk'
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x16): undefined reference to `_write'
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x12): undefined reference to `_close'
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x14): undefined reference to `_fstat'
c:/nxp/lpcxpresso_4.0.5_123/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o):
0 项奖励
回复
3 回复数

1,036 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Apr 02 01:47:22 MST 2012
acordat - you are not seeing the same problem as OXO was. OXO's problem looks like it was related to the C library variant being linked to, as per:

http://support.code-red-tech.com/CodeRedWiki/UndefinedReference

However the errors you are seeing do not appear to be C library related. They largely appear to be related to symbols not being defined that are provided by the linker script that LPCXpresso will normally autogenerate for you.

It also appears that you are trying to create a C++ project, which the LPCXpresso IDE does not support doing.

Please can you explain exactly how you created the project that you are trying to build here? The normal way to create a project in LPCXpresso is to use the project wizard provided by the Quickstart view.

Regards,
CodeRedSupport
0 项奖励
回复

1,036 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by aco31 on Fri Mar 30 15:47:44 MST 2012
hi OXO,

I have same issue...
arm-none-eabi-c++ -mcpu=cortex-m3 -mthumb -o"monitorTemp"  ./src/adc.o ./src/cr_startup_lpc17.o ./src/leds.o ./src/main.o  
c:/nxp/lpcxpresso_4.1.0_190/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 0000800c
./src/cr_startup_lpc17.o: In function `ResetISR':
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:234: undefined reference to `_data'
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:234: undefined reference to `_data'
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:254: undefined reference to `SystemInit'
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:266: undefined reference to `__main'
./src/cr_startup_lpc17.o: In function `IntDefaultHandler':
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:363: undefined reference to `_bss'
C:\Users\alain\ARM_LPCXPRESSO\workSpace\monitorTemp\Debug/../src/cr_startup_lpc17.c:363: undefined reference to `_ebss'
./src/cr_startup_lpc17.o:(.isr_vector+0x0): undefined reference to `_vStackTop'
0 项奖励
回复

1,036 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jul 24 08:33:12 MST 2011
Sounds like newlib printf problem?
0 项奖励
回复