bash
RT-Thread Components > C/C++ and POSIX layer
scons构建项目会出错:
vim libraries/SConscript ,删除 pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp(切记不要注释,要删除)
再次scons构建项目,报错:
在项目根目录下,打开link.ld,在text字段下,添加如下内容:
bash
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
切记不要在text字段的头部添加该内容,否则报错如下:
bash
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
CXX = rtconfig.CXX,CXXFLAGS = rtconfig.CXXFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
然后scons完成项目构建: