linux - Eclipse GCC C Cross Compiling for OpenWrt not working -


i beginner in both linux , openwrt. sorry if stupid question.

i following tutorial : https://downloads.openwrt.org/docs/eclipse.pdf

  • chip : mt7620
  • toolchain prefix : mipsel-openwrt-linux-
  • toolchain path : /ligo/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.14

code:

#include <stdio.h> void main() {     printf("hello world"); } 

error:

**** build of configuration debug project hello **** make  building target: hello invoking: cross gcc linker mipsel-openwrt-linux-gcc -l/ligo/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.14/lib -o"hello"  ./main.o    mipsel-openwrt-linux-gcc: warning: environment variable 'staging_dir' not defined mipsel-openwrt-linux-gcc: warning: environment variable 'staging_dir' not defined /ligo/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.14/lib/gcc/mipsel-openwrt-linux-musl/5.3.0/../../../../mipsel-openwrt-linux-musl/lib/crt1.o: in function `_start_c': /ligo/openwrt/build_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.14/musl-1.1.14/crt/crt1.c:17: undefined reference `main' /ligo/openwrt/build_dir/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.14/musl-1.1.14/crt/crt1.c:17: undefined reference `main' collect2: error: ld returned 1 exit status make: *** [hello] error 1 

add following 2 lines @ end of bashrc

  • export path=$path:~/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uclibc-0.9.33.2/bin export staging_dir=~/openwrt/staging_dir

  • source ~/.bashrc

to open/create bashrc can execute

  • sudo gedit ~/.bashrc

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -