#author("2019-10-31T13:33:12+08:00","default:Admin","Admin") OpenWRT unexpected word (expecting ")") †开发板运行一个简单的helloworld而已,却出现如下错误. unexpected word (expecting ")") 有以下可能
ald@ald888:/work/openwrt/trunk/package/sncom/src$ mipsel-openwrt-linux-gcc -c serial.c -o serial mipsel-openwrt-linux-uclibc-gcc.bin: warning: environment variable 'STAGING_DIR' not defined ald@ald888:/work/openwrt/trunk/package/sncom/src$ cp serial /mnt/hgfs/share/ ald@ald888:/work/openwrt/trunk/package/sncom/src$ file serial serial: ELF 32-bit LSB relocatable, MIPS, MIPS-I version 1 (SYSV), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, not stripped 下面是正常的 ald@ald888:/work/openwrt/trunk/package/sncom/src$ mipsel-openwrt-linux-gcc serial.c -o serial mipsel-openwrt-linux-uclibc-gcc.bin: warning: environment variable 'STAGING_DIR' not defined mipsel-openwrt-linux-uclibc-gcc.bin: warning: environment variable 'STAGING_DIR' not defined mipsel-openwrt-linux-uclibc-gcc.bin: warning: environment variable 'STAGING_DIR' not defined ald@ald888:/work/openwrt/trunk/package/sncom/src$ ls Makefile serial serial.c serial_pc snshm ald@ald888:/work/openwrt/trunk/package/sncom/src$ file serial serial: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, not stripped ald@ald888:/work/openwrt/trunk/package/sncom/src$ cp serial /mnt/hgfs/share/ald@ald888:/work/openwrt/trunk/package/sncom/src$ make package/mydrv_app/compile V=99 命令生成安装包的路径 /work/openwrt/trunk/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/snsh/ipkg-ramips_24kec/snsh/usr/sbin 最终生成安装包ipk文件的路径 /work/openwrt/trunk/bin/ramips/packages/base 解决方法 在头部加分号; /bin/ash :./helloworld permission denied. †问题:/bin/ash :./helloworld permission denied. 没有root账户就无法创建文件,如果用root就不许编译 原因: ls -l helloworld 发现helloworld 根本没有执行权限。 解决方法:
1. arm-linux-gcc helloworld.c -o helloworld
之前是arm-linux-gcc -c helloworld.c -o helloworld 因为gcc -c是编译为目标文件,-o是指定生成文件的名字。 2. chmod -x helloworld. connect error: Connection refused †root@OpenWrt:/# snsh [init] ser2netThread starting... [socket] ser2netThread starting.... [socket] connect error: Connection refused ser2net没有启动造成的 あなたのお住まいの地域で最安のブロードバンド選び コメント: |