免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 9434 | 回复: 19
上一主题 下一主题

[操作系统] 提示undefined reference to `memset' [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-05-09 09:49 |只看该作者 |倒序浏览
一直提示这个,但是代码没有用到这个函数。很困惑。

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
2 [报告]
发表于 2014-05-09 13:27 |只看该作者
可能有宏定义用了这个吧

论坛徽章:
0
3 [报告]
发表于 2014-05-09 14:15 |只看该作者
回复 2# amarant


    是不是gcc版本问题?

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
4 [报告]
发表于 2014-05-09 15:34 |只看该作者
回复 3# foming


    可以的话把代码贴出来看看,不会是gcc的问题。如果还有问题你可以加上头文件#include <stdlib.h>

论坛徽章:
0
5 [报告]
发表于 2014-05-09 15:40 |只看该作者
回复 4# amarant


    ###########################################################################
#
# get our software configure
#
#ifeq (.config,$(wildcard .config))

CONFIGED:= $(shell if [ -a .config ]; then echo yes; else echo no; fi)
ifeq (${CONFIGED}, yes)
include .config
all: subdirs rootfs romfs
else
all: help
        @exit 1
endif

# config_error
ROOTDIR  = $(shell pwd)
#export KB_DIR=$(ROOTDIR)/build/blp/kernel
include BaseVar.mk
#include Rules.make

DIRS =  build/
-include quicktarget.mk
###########################################################################
help:
        @echo "*************************************************"
        @echo "The build sequence for this source tree is:"
        @echo "1. 'make tools'"
        @echo "2. 'make prepare'"
        @echo "3. 'make'"
        @echo "4. 'make rootfs'"
        @echo "5. 'make romfs'"
        @echo "**************************************************"
        @echo "**************************************************"
        @echo "make prodefconfig : recover product default config"
        @echo "make refresh_dirs : Refresh the symbol links      "       
        @echo "make mrproper     : Clean all build files         "       
        @echo "make switch              : Switch product                "       
        @echo "**************************************************"
        @echo "Quick Build Targets(QuickTarget) "
        @echo ""
        @echo "Quick Clean Targets(QuickCleanTarget) "
        @echo ""
        @echo "Quick DistClean Targets(QuickDistCleanTarget) "
        @echo ""
        @echo "Quick Install Targets(QuickInstallTarget) "

.PHONY: subdirs clean menuconfig scripts prepare tools build_lib
subdirs: build $(DIRS) build_lib
        for dir in $(DIRS) ; do [ ! -d $$dir ] || make -C $$dir || exit 1 ; done
install: $(DIRS)
        for dir in $(DIRS) ; do [ ! -d $$dir ] || make -C $$dir install || exit 1 ; done
clean:
        echo $(DIRS)
        for dir in $(DIRS) ; do [ ! -d $$dir ] || make -C $$dir clean || exit 1 ; done

checkautoproduct:
ifndef AUTOPRODUCT
        @echo autobuild need define PRODUCT,ex:"make autobuild AUTOPRODUCT=UML"
        @exit -1
endif

ckconfig:
        $(Q)cp -f build/product/defconfig build/.config
        $(Q)cd build;mkdir -p include/config;../scripts/conf -s ../Config.in 2>/dev/null
        $(Q)defconfig=`readlink build/product/defconfig`;\
        SVNST=`svn st $$defconfig`;\
        if [ "-$${SVNST}" != "-" ]; then \
          echo ;echo;echo;\
          echo "******Warning!!!        ************";\
          echo "*The defconfig need to commit";\
          echo "*";\
          echo $${SVNST}; \
          echo "*";\
          echo "************************************";\
        fi

autoprepare:checkautoproduct scripts
        @sh $(ROOTDIR)/tools/mkbuilddir $(AUTOPRODUCT)
        @sh $(ROOTDIR)/tools/prepareBLP.sh
        cd build;mkdir -p include/config;../scripts/conf -s ../Config.in
        $(Q)rm -f .config; echo "ok!!!"
        $(Q)ln -s build/.config .config;
       
autobuild:checkautoproduct tools autoprepare
        make subdirs rootfs romfs

##scripts目标在quicktarget.mk定义
menuconfig: scripts
        $(Q)if [ -f .config -a ! -L .config ]; then mv .config build/; fi;
        $(Q)cd build;mkdir -p include/config; ../scripts/mconf ../Config.in;../scripts/conf -s ../Config.in
        $(Q)rm -f .config; echo "ok!!!"
        $(Q)ln -s build/.config .config;
#        $(Q)cp -f build/.config build/product/defconfig;

defconfig:
        svn revert product/$(PRODUCT)/defconfig;
        $(Q)cp -f build/product/defconfig build/.config;
        make menuconfig

mangle_config:
        $(Q)cp -f build/.config build/product/defconfig;

switch:
        $(Q)./tools/switch.sh       

mrproper:
        $(Q)echo  "Are you sure to remove ALL PRODUCTS files(yes/no)";
        $(Q)read item;\
                if [ ! "$${item}" = "yes" ]; then exit -1; fi;
        rm -rf build build.* arch.mk;
        $(Q)rm -f .config
       
distclean:clean
        -for dir in $(DIRS) ; do [ ! -d $$dir ] || make -C $$dir distclean || exit 1 ; done
       
prepare: prepare_dirs menuconfig

prepare_dirs:
        @sh $(ROOTDIR)/tools/mkbuilddir
        @sh $(ROOTDIR)/tools/prepareBLP.sh

prepare_kernel:
        @sh $(ROOTDIR)/tools/prepareBLP.sh

refresh_dirs:
        $(Q)sh ${ROOTDIR}/tools/mksymlink src/ build/

rootfs:rootfs_clean install_rootfs install install_profile
        $(Q)cd $(FSROOT);tar cf etc/var.tar var
        -find $(FSROOT) -name .svn | xargs rm -rf

install_rootfs:
        @sh $(ROOTDIR)/tools/buildRootfs.sh
        @echo "install_rootfs ok!"

libopt:
        -$(Q)if [ ! -d ${BUILDDIR}/templib ]; then mkdir -p ${BUILDDIR}/templib; fi;
        -$(Q)python $(ROOTDIR)/tools/mklibs.py -D -L $(FSROOT)/lib/ -L $(TOOLCHAINS_SYSROOT)/lib/ --target=$(TOOLCHAINS_PATH)/rsdk-linux- -d $(BUILDDIR)/templib `find $(FSROOT) -path $(FSROOT)/lib -prune -o -type f -print | file -f - | grep ELF | cut -d':' -f1`
        -$(Q)cp ${BUILDDIR}/templib/* ${FSROOT}/lib/
       
kernel_strip:
        @echo "Stripping kernel modules..."
ifeq ($(CONFIG_MODULES), y)
        $(STRIP) --strip-debug --strip-unneeded `find $(FSROOT)/lib/modules -type f -print | file -f - | grep ELF | cut -d':' -f1`
        @echo "strip kernel modules ok!"
else
        @echo "modules disabled in current config, skipping ..."
endif

apps_strip:
        @echo "Stripping userapps and shared libraries more..."
        #$(SSTRIP) `find $(FSROOT) -path $(FSROOT)/lib/modules -prune -o -type f -print | file -f - | grep ELF | cut -d':' -f1`
        #$(LSTRIP) $(FSROOT)
        $(ROOTDIR)/tools/rsdk-linux-lstrip $(FSROOT)
        @echo "strip userapps and shared libraries ok!"       
ifdef CONFIG_APPS_SSAP_ALLSTANDARD
        sed 's/Standard="[01]"//g' $(FSROOT)/etc/config_full.xml > config_full.xml
        cp -f config_full.xml $(FSROOT)/etc/;
        rm -f ./config_full.xml;
        sed 's/Standard="[01]"//g' $(FSROOT)/etc/config.xml > config.xml
        cp -f config.xml $(FSROOT)/etc/;
        rm -f ./config.xml;
endif
ifdef CONFIG_APPS_SSAP_ALLWRITABLE
        sed 's/Writable="[01]"//g' $(FSROOT)/etc/config_full.xml > config_full.xml
        cp -f config_full.xml $(FSROOT)/etc/;
        rm -f ./config_full.xml;
        sed 's/Writable="[01]"//g' $(FSROOT)/etc/config.xml > config.xml
        cp -f config.xml $(FSROOT)/etc/;
        rm -f ./config.xml;
endif
ifdef CONFIG_APPS_SSAP_STRIPTYPE
        cat $(FSROOT)/etc/config_full.xml | sed -f tools/sed_strip_type.script >config_full.xml
        cp -f config_full.xml $(FSROOT)/etc/;
        rm -f ./config_full.xml;
        cat $(FSROOT)/etc/config.xml | sed -f tools/sed_strip_type.script >config.xml
        cp -f config.xml $(FSROOT)/etc/;
        rm -f ./config.xml;
endif

install_profile:
        $(Q) if [ -f $(ROOTDIR)/build/product/installProfile.sh ]; then sh $(ROOTDIR)/build/product/installProfile.sh;fi;
        @echo "install profile file ok!"



multi_lang:
        @mkdir -p ${ROOTDIR}/build/romfs/multi_lang
#        do something

romfs:kernel_strip apps_strip  multi_lang
        @rm -rf $(FSROOT)/var/*
        @sh $(ROOTDIR)/tools/buildImage.sh

tools:
        $(Q)make -C tools/src install

tools_clean:
        $(Q)make -C tools/src clean

rootfs_clean:
        @rm ${ROOTDIR}/build/romfs/rootfs/* -fr

build_lib:
#        make openssl
               

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
6 [报告]
发表于 2014-05-09 15:47 |只看该作者
回复 5# foming


    看你的makefile好像是交叉编译吧?你要确认你的工具琏是不是设置正确了。给kernel编译module的步骤也建议你上网看看,很多相关的文章。你这个问题,如果你不能表述的很明白,别人很难帮助到你。

论坛徽章:
0
7 [报告]
发表于 2014-05-09 16:10 |只看该作者
回复 6# amarant


    toolchain直接make的

论坛徽章:
0
8
发表于 2014-05-09 16:12
回复 6# amarant


    完整代码在此处,你下载看看http://www.downloads.netgear.com ... .18_src.tar.bz2.zip

论坛徽章:
0
9 [报告]
发表于 2014-05-09 16:13 |只看该作者
回复 6# amarant


    按照里面的说明操作的。

论坛徽章:
0
10
发表于 2014-05-09 16:16
回复 6# amarant


    不知道你说的给kernel编译module的是什么,我的是嵌入式源码,现在直接编译的,我看不明白的你意思。或者下载个完整代码试试。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP