Hello, I'm new here of openwrt.Also new for cross complier. Sorry for my english

    I want to build an openwrt-arm-img runing on some vm environment (like virtual box or qemu).
    Useing Eclipse for develop on openwrt by remote to vm environment.


#1 Make:
   I had svn  trunk from openwrt.org. used make menuconfig to set target system with ARM Ltd .Realview board (qemu).
   Check the "build openwrt sdk" "toolchain".
   When I type command  "make toolchain/install". It show no error.
   "make V=s" show some error that I can't work out.
    When I “make menuconfig" set target system with Atheros AR7xxx/AR9xxx. "make V=s" never show error.

    Error:
====================================================================
make[5]: Entering directory '/opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/tools/env'
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-uclibcgnueabi-gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/include -idirafter /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/include2 -idirafter /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/include -idirafter /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/tools/env -DUSE_HOSTCC -DTEXT_BASE=  -o fw_printenv /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/lib/crc32.c  fw_env.c  fw_env_main.c /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/lib/ctype.c /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/lib/linux_string.c /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/common/env_attr.c /opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/common/env_flags.c
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
cc1: note: someone does not honour COPTS correctly, passed 0 times
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/ccLcw0Xh.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/ccLcw0Xh.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/ccCnQlac.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/ccCnQlac.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/cc42Cgt6.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/cc42Cgt6.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/cc6YgfO0.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/cc6YgfO0.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/ccYLO3dV.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/ccYLO3dV.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/cc0QS4LP.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/cc0QS4LP.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: error: fw_printenv uses VFP register arguments, /tmp/ccmXYnuK.o does not
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: failed to merge target specific data of file /tmp/ccmXYnuK.o
/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.6.4/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: warning: .init_array section has zero size
collect2: ld returned 1 exit status
Makefile:31: recipe for target 'fw_printenv' failed
make[5]: *** [fw_printenv] Error 1
make[5]: Leaving directory '/opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/tools/env'
Makefile:812: recipe for target 'env' failed
make[4]: *** [env] Error 2
make[4]: Leaving directory '/opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10'
Makefile:89: recipe for target '/opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/.built' failed
make[3]: *** [/opt/openwrt/trunk/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/u-boot-2013.10/.built] Error 2
make[3]: Leaving directory '/opt/openwrt/trunk/package/boot/uboot-envtools'
package/Makefile:162: recipe for target 'package/boot/uboot-envtools/compile' failed
make[2]: *** [package/boot/uboot-envtools/compile] Error 2
make[2]: Leaving directory '/opt/openwrt/trunk'
package/Makefile:159: recipe for target '/opt/openwrt/trunk/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.package_compile' failed
make[1]: *** [/opt/openwrt/trunk/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/opt/openwrt/trunk'
/opt/openwrt/trunk/include/toplevel.mk:160: recipe for target 'world' failed
make: *** [world] Error 2
====================================================================

   
#2 eclipse for openwrt

     Followed by this title : http://wiki.openwrt.org/doc/devel/eclipse

AgentBySocat_OpenWRT.c
====================================================================

#include <iostream>

using namespace std;

int main() {
    int i = 0;
    for (i=0; i<10; i++)
    {
        cout << "Hello OpenWrt" << endl;
    }
    return 0;
}
====================================================================

Build Error(make):
====================================================================
make[1] world
make[2] target/compile
make[3] -C target/linux compile
make[2] package/cleanup
make[2] package/compile
make[3] -C package/libs/toolchain compile
make[3] -C package/libs/libnl-tiny compile
make[3] -C package/libs/libjson-c compile
make[3] -C package/utils/lua compile
make[3] -C package/libs/libubox compile
make[3] -C package/system/ubus compile
make[3] -C package/system/uci compile
make[3] -C package/network/config/netifd compile
make[3] -C package/system/opkg host-compile
make[3] -C package/system/ubox compile
make[3] -C package/system/procd compile
make[3] -C package/base-files compile
make[3] -C package/boot/uboot-envtools compile
make -r world: build failed. Please re-run make with V=s to see what's going on
/opt/openwrt/trunk/include/toplevel.mk:160: recipe for target 'world' failed
make: *** [world] Error 1
====================================================================
(Make V=s)
====================================================================
09:03:23 **** Build of configuration Debug for project AgentBySocat_OpenWRT ****
make all
Building file: ../src/AgentBySocat_OpenWRT.cpp
Invoking: Cross G++ Compiler
arm-openwrt-linux-g++ -I/opt/openwrt/trunk/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/arm-openwrt-linux/lib -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/AgentBySocat_OpenWRT.d" -MT"src/AgentBySocat_OpenWRT.d" -o "src/AgentBySocat_OpenWRT.o" "../src/AgentBySocat_OpenWRT.cpp"
arm-openwrt-linux-g++: warning: environment variable 'STAGING_DIR' not defined
Finished building: ../src/AgentBySocat_OpenWRT.cpp

Building target: AgentBySocat_OpenWRT
Invoking: Cross G++ Linker
arm-openwrt-linux-g++  -o "AgentBySocat_OpenWRT"  ./src/AgentBySocat_OpenWRT.o   
arm-openwrt-linux-g++: warning: environment variable 'STAGING_DIR' not defined
arm-openwrt-linux-g++: warning: environment variable 'STAGING_DIR' not defined
makefile:45: recipe for target 'AgentBySocat_OpenWRT' failed
/usr/lib/libstdc++.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [AgentBySocat_OpenWRT] Error 1
09:03:24 Build Finished (took 254ms)
====================================================================


Thank you for your time~