We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

OpenWRT sdk compiling helloword.c



  • "Salut" everybody.

    I love python : it was very simple to use, to debug and so ... what about C/C++ šŸ˜”

    i've found a Tuto_C.pdf Tuto on WEB for compiling with SDK.

    So i've use this C file helloworld.c and this Makefile Makefile .

    I've put them in the /home/user/dev/openwrt/openwrtSDK/package/helloworld

    after open console at /home/user/dev/openwrt/openwrtSDK/

    make -j1 V=99
    

    compilation abort with this error about obsolete description bloc

    make[4]: Entering directory `/home/user/dev/openwrt/openwrtSDK/build_dir/target-mips_34kc_uClibc-0.9.33.2/helloworld'
    Makefile:64: *** DESCRIPTION:= is obsolete, use Package/PKG_NAME/description.  Stop.
    make[4]: Leaving directory 
    
    `/home/user/dev/openwrt/openwrtSDK/build_dir/target-mips_34kc_uClibc-0.9.33.2/helloworld'
    make[3]: *** [/home/user/dev/openwrt/openwrtSDK/build_dir/target-mips_34kc_uClibc-0.9.33.2/helloworld/.built] Error 2
    
    OpenWRT sdk compiling helloword.c
    
      Discard SubmitToggle Dropdown
    Enter tags here, between 2 and 15 characters each.
    COMPOSE 
    
    make[3]: Leaving directory `/home/user/dev/openwrt/openwrtSDK/package/helloworld'
    

    But this command is not in any Makefile ...

    Some one can help me please ...



  • NO help ... yet. No compilation too.



  • make[1]: Entering directory /home/gwena/dev/omega/openwrt' make[1]: *** No rule to make target package/helloworld/compile'. Stop.
    make[1]: Leaving directory `/home/gwena/dev/omega/openwrt'
    make: *** [package/helloworld/compile] Erreur 2

    No Help, No Help .... SOS

    gwena@MacBookPro:~/dev/omega/openwrt$ make /package/helloworld/compile
    ERROR: please fix package/helloworld/Makefile - see logs/package/helloworld/dump.txt for details
    Collecting package info: done
    make[1] /package/helloworld/compile
    make -r /package/helloworld/compile: build failed. Please re-run make with -j1 V=s to see what's going on
    make: *** [/package/helloworld/compile] Erreur 1
    gwena@MacBookPro:~/dev/omega/openwrt$

    makefile:116: *** commands commence before first target. Stop.



  • @Gwena56 I congratulate you on being brave enough to try to tackle the OpenWrt build system - something that I still have not got to grips with yet šŸ˜ž

    However, there is a much simpler method to build basic C/C++ code for the Omega that I regularly use. You just need the basic OpenWrt tool chain from https://s3-us-west-2.amazonaws.com/onion-cdn/community/openwrt/OpenWrt-Toolchain-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2 See the following posts for references:

    Rather than the OpenWrt package Makefile that you posted, you will just need a basic Unix Makefile something like:

    • ~/helloworld/src/Makefile:
      # build helloworld executable when user executes "make"
      helloworld: helloworld.o
      $(CC) $(LDFLAGS) helloworld.o -o helloworld
      helloworld.o: helloworld.c
      $(CC) $(CFLAGS) -c helloworld.c
      # remove object files and executable when user executes "make clean"
      clean:
      rm *.o helloworld

    Modified appropriately for your requirements

    Good luck šŸ™‚


  • administrators

    @Gwena56 This is awesome! We're really swamped right now getting the cloud ready to release, but we'll be able to help in the coming weeks, sorry!

    We also plan to launch a cloud cross compilation service in the coming months. Stay tuned!



  • Hi @Gwena56, sorry for the late reply. Your error message says No rule to make target, which can mean that you didn't specify where the build environment is looking for the source. Can you add the following line and see if it changes anything?

    PKG_SOURCE_SUBDIR:=$(PKG_NAME)
    

    Also, makefile is very strict about whitespaces, so remove the TAB before petite description.

    Please let me know if this helps.

    Cheers!



  • Thanks for help ... Send you feed back soon ...
    I'm trying to make a rf433 remote ...



  • nothing better happen ... c++ c šŸ˜” šŸ‘Š šŸ’„ compile toolchain ... .cpp segment .c šŸ˜± šŸ‘Ž ... trying python



Looks like your connection to Community was lost, please wait while we try to reconnect.