Homework 3

#1 统计正数和负数的个数计算平均值

a = 0
b = 0
sum = 0
d = 1
while d != 0:
    d= int(input('Enter an intenger[输入0结束]:'))
    if d > 0 : 
        a += 1
    elif d <0:
        b += 1
    sum += d
print('正数个数:%d'%a)
print('负数个数:%d'%b)
aver = sum/(a+b)
print('平均值:%f'%aver)





#2计算未来学费

a = [10000]
for i in range(14):
    c = a[i] * 1.05
    a.append(c)
    print('十四年后的学费:%.2f'%c)
    if i  == 9:
        print('总的学费:%2f'%sum(a))


#4同时被5和6整除

t =0
for i in range(100,1000):
    if i % 5 ==0 and i % 6 ==0:
        print(i,end=' ')
        t +=1
        if t%10 ==0:
            print('\n')




#5

n =0
while n**2 < 12000:
    n +=1
print(n)


m = 0
while m**3 < 12000:
    m += 1
print(m)




#6
n = 0
for i in range(1,50001,1):
    n += 1/i
print(n)


n = 0
for i in range(50001,0,1):
    n += 1/i
print(n)




#7

num = 0
for i in range(1,98,2):
    
    num += i/(i+2)
print(num)





#8

i = 1
pai = 0

while i >0:
    num = 4*((-1)**(1+i)/(2*i-1))
    i += 1
    pai += num
    if i % 10000 ==0:
        print(pai)
    elif i > 100000:
        break



#9

for i in range(1,10000):
    a = 0
    for j in range(1,i):
        if i % j ==0:
            a += j
    if i == a:
        print(i)





#10

sum = 0
for i in range(1,8):
    for j in range(1,8):
        if i != j:
            print(i,j)
            sum += 1
print(sum)





#11
def mean():
    b = 0
    for i in range(10):
        a = int(input('请输入第数字:'))
        b += a     
    mea = b/10
    print(mea)

mean()

$ make package/ubus_ipc_crc/compile V=99 make[1]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/toolchain&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libpthread" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/toolchain&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libjson-c&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install.clean; fi; echo "libjson-c" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libjson-c&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/utils/lua&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean; fi; echo "liblua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean; fi; echo "lua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/utils/lua&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libubox&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libubox" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libblobmsg-json" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "jshn" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libjson-script" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libubox&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/system/ubus&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "libubus" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "libubus-lua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "ubus" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "ubusd" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/system/ubus&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/ubus_ipc_crc&#39; mkdir -p /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc cp -fpR ./src/* /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.prepared_17edf9e0d8c7e2d69ed91b923871c7b2 rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.ubus_ipc_crc_installed (cd /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/./; if [ -x ./configure ]; then find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.guess | xargs -r chmod u+w; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.guess | xargs -r -n1 cp --remove-destination /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/config.guess; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.sub | xargs -r chmod u+w; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.sub | xargs -r -n1 cp --remove-destination /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/config.sub; AR="arm-openwrt-linux-uclibcgnueabi-gcc-ar" AS="arm-openwrt-linux-uclibcgnueabi-gcc -c -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard" LD=arm-openwrt-linux-uclibcgnueabi-ld NM="arm-openwrt-linux-uclibcgnueabi-gcc-nm" CC="arm-openwrt-linux-uclibcgnueabi-gcc" GCC="arm-openwrt-linux-uclibcgnueabi-gcc" CXX="arm-openwrt-linux-uclibcgnueabi-g++" RANLIB="arm-openwrt-linux-uclibcgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-uclibcgnueabi-strip OBJCOPY=arm-openwrt-linux-uclibcgnueabi-objcopy OBJDUMP=arm-openwrt-linux-uclibcgnueabi-objdump SIZE=arm-openwrt-linux-uclibcgnueabi-size CFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CXXFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CPPFLAGS="-I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " LDFLAGS="-L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib " ./configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; ) rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.configured_* touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.configured_yyy arm-openwrt-linux-uclibcgnueabi-gcc -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -std=c99 -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubus -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubox /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/crc32.c -o /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -lubus -lubox -lm /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:79:5: warning: implicit declaration of function &#39;UBUS_OBJECT&#39; [-Wimplicit-function-declaration] UBUS_OBJECT("data_service", &hello_obj_type, hello_methods, ARRAY_SIZE(hello_methods)); ^ /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:79:5: error: invalid initializer Makefile:48: recipe for target &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.built&#39; failed make[2]: *** [/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.built] Error 1 make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/ubus_ipc_crc&#39; package/Makefile:191: recipe for target &#39;package/ubus_ipc_crc/compile&#39; failed make[1]: *** [package/ubus_ipc_crc/compile] Error 2 make[1]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1&#39; /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/include/toplevel.mk:181: recipe for target &#39;package/ubus_ipc_crc/compile&#39; failed make: *** [package/ubus_ipc_crc/compile] Error 2 shihaopeng@shihaopeng-virtual-machine11:~/Desktop/CODE/homework3/openwrt-15.05.1$ cat /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target -arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubus/libubus.h cat: /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubus/libubus.h: No such file or directory shihaopeng@shihaopeng-virtual-machine11:~/Desktop/CODE/homework3/openwrt-15.05.1$ make package/ubus_ipc_crc/compile V=99 make[1]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/toolchain&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libpthread" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/toolchain&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libjson-c&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install.clean; fi; echo "libjson-c" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libjson-c.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libjson-c&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/utils/lua&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean; fi; echo "liblua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install.clean; fi; echo "lua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/lua.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/utils/lua&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libubox&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libubox" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libblobmsg-json" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "jshn" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install.clean; fi; echo "libjson-script" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/libubox.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/libs/libubox&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/system/ubus&#39; if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "libubus" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "libubus-lua" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "ubus" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install.clean; fi; echo "ubusd" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/system/ubus&#39; make[2]: Entering directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/ubus_ipc_crc&#39; mkdir -p /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc cp -fpR ./src/* /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.prepared_17edf9e0d8c7e2d69ed91b923871c7b2 rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.ubus_ipc_crc_installed (cd /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/./; if [ -x ./configure ]; then find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.guess | xargs -r chmod u+w; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.guess | xargs -r -n1 cp --remove-destination /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/config.guess; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.sub | xargs -r chmod u+w; find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ -name config.sub | xargs -r -n1 cp --remove-destination /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/config.sub; AR="arm-openwrt-linux-uclibcgnueabi-gcc-ar" AS="arm-openwrt-linux-uclibcgnueabi-gcc -c -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard" LD=arm-openwrt-linux-uclibcgnueabi-ld NM="arm-openwrt-linux-uclibcgnueabi-gcc-nm" CC="arm-openwrt-linux-uclibcgnueabi-gcc" GCC="arm-openwrt-linux-uclibcgnueabi-gcc" CXX="arm-openwrt-linux-uclibcgnueabi-g++" RANLIB="arm-openwrt-linux-uclibcgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-uclibcgnueabi-strip OBJCOPY=arm-openwrt-linux-uclibcgnueabi-objcopy OBJDUMP=arm-openwrt-linux-uclibcgnueabi-objdump SIZE=arm-openwrt-linux-uclibcgnueabi-size CFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CXXFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CPPFLAGS="-I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " LDFLAGS="-L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib " ./configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; ) rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.configured_* touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.configured_yyy arm-openwrt-linux-uclibcgnueabi-gcc -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -std=c99 -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubus -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubox /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/crc32.c -o /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -lubus -lubox -lm /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:84:5: warning: braces around scalar initializer [enabled by default] .id = { 0 }, ^ /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:84:5: warning: (near initialization for &#39;hello_obj.id&#39;) [enabled by default] /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:85:5: warning: braces around scalar initializer [enabled by default] .path = { 0 }, ^ /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:85:5: warning: (near initialization for &#39;hello_obj.path&#39;) [enabled by default] arm-openwrt-linux-uclibcgnueabi-gcc -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -std=c99 -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubus -I/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include/libubox /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/a_client.c /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/crc32.c -o /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/a_client -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib -lubus -lubox -lm touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/.built mkdir -p /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/bin/realview/packages /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/CONTROL /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo install -d -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/usr/bin install -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/usr/bin/ install -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/a_client /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/usr/bin/ find /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc -name &#39;CVS&#39; -o -name &#39;.svn&#39; -o -name &#39;.#*&#39; -o -name &#39;*~&#39;| xargs -r rm -rf export CROSS="arm-openwrt-linux-uclibcgnueabi-" NO_RENAME=1 ; NM="arm-openwrt-linux-uclibcgnueabi-nm" STRIP="/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/host/bin/sstrip" STRIP_KMOD="/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/strip-kmod.sh" PATCHELF="/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/host/bin/patchelf" /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/rstrip.sh /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc rstrip.sh: /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/usr/bin/b_server: executable rstrip.sh: /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/usr/bin/a_client: executable (cd /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc/CONTROL; ( echo "$CONTROL"; printf "Description: "; echo "$DESCRIPTION" | sed -e &#39;s,^[[:space:]]*, ,g&#39;; ) > control; chmod 644 control; ( echo "#!/bin/sh"; echo "[ \"\${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_postinst \$0 \$@"; ) > postinst; ( echo "#!/bin/sh"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_prerm \$0 \$@"; ) > prerm; chmod 0755 postinst prerm; ) install -d -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/bin/realview/packages/base /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/scripts/ipkg-build -c -o 0 -g 0 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/bin/realview/packages/base Packaged contents of /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/ipkg-realview/ubus_ipc_crc into /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/bin/realview/packages/base/ubus_ipc_crc_1_realview.ipk rm -rf /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc mkdir -p /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/stamp /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc install -d -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc/usr/bin install -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc/usr/bin/ install -m0755 /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/a_client /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc/usr/bin/ SHELL= /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/host/bin/flock /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/tmp/.root-copy.flock -c &#39;cp -fpR /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc/. /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/&#39; rm -rf /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/tmp-ubus_ipc_crc touch /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/root-realview/stamp/.ubus_ipc_crc_installed if [ -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus_ipc_crc.default.install.clean ]; then rm -f /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus_ipc_crc.default.install /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus_ipc_crc.default.install.clean; fi; echo "ubus_ipc_crc" >> /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/ubus_ipc_crc.default.install make[2]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/package/ubus_ipc_crc&#39; make[1]: Leaving directory &#39;/home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1&#39;
08-10
你这次的编译输出显示: ``` /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:84:5: warning: braces around scalar initializer [enabled by default] .id = { 0 }, ^ ``` 以及: ``` /home/shihaopeng/Desktop/CODE/homework3/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/ubus_ipc_crc/b_server.c:85:5: warning: braces around scalar initializer [enabled by default] .path = { 0 }, ^ ``` --- ## 🔍 问题分析 这些警告说明: > **你对 `.id` 和 `.path` 字段使用了花括号 `{}` 初始化,但它们是标量类型(非数组或结构体)**,所以编译器提示“花括号多余”。 --- ## ✅ 解决方案 ### ✅ 修改初始化方式 将: ```c .id = { 0 }, .path = { 0 }, ``` 改为: ```c .id = 0, .path = "", ``` 或者如果你希望保持兼容性,也可以直接省略这些字段,因为它们会被自动初始化为 0 或 NULL。 --- ## ✅ 最终兼容 OpenWrt 15.05.1 的 `struct ubus_object` 初始化如下: ```c static struct ubus_object hello_obj = { .name = "data_service", .type = &hello_obj_type, .methods = hello_methods, .n_methods = ARRAY_SIZE(hello_methods), }; ``` > ⚠️ 注意:如果你使用的是 **老版本 `libubus`**,`struct ubus_object` 中的 `.id` 和 `.path` 可能并不存在,所以 **不要手动初始化它们**。 --- ## 🧠 为什么 `.id = { 0 },` 会报错? ### 原因: 在老版本的 `libubus` 中,`.id` 是一个 `uint32_t` 类型(即一个整数),你用 `{ 0 }` 初始化它,是数组初始化方式,而它不是数组,所以编译器报错。 --- ## ✅ 总结 | 问题 | 原因 | 解决方案 | |------|------|----------| | `braces around scalar initializer` | 初始化标量字段时用了数组初始化语法 | 改为直接赋值,或省略字段 | | `.id = { 0 }` 报错 | `.id` 是 `uint32_t` 类型,不是数组 | 改为 `.id = 0` | | `.path = { 0 }` 报错 | `.path` 是 `char[]` 或 `char*` 类型 | 改为 `.path = ""` 或省略 | | `UBUS_OBJECT()` 宏未定义 | OpenWrt 15.05.1 不支持该宏 | 手动初始化 `struct ubus_object` | ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值