Programming simple C/C++ executables for Omega from PC
I would like to write some programs for Omega2 in C or C++ since it has not enough flash memory to install Node.js and js modules properly. Therefore I would like to code my program in C/C++. I have been browsing through forum and stumbled upon cross-compilation. As I understand it, it is actually ment to compile kernel, which I don't need. Also when I was following steps on the tutorial of cross-compilation, when I ran command 'make', there was an error "yynyyyyynyyyyynyyn..."
So is there some nice tutorial how to set up comiler enviroment on VMware - Ubuntu, so I could compile some C++ program that would work on Omega2.
Thanks a lot.
I have found a simple way how to do it. Someone have made VirualBox image with all neccesarry tools needed:
Does anyone knows how to add separate libraries like curl, without using "make" comand, as it never ends and causes errors.
Fabian Nydegger 0
I'm not sure, if it's what you ment but.
install curl on omega:
echo "src/gz reboot_base https://downloads.lede-project.org/releases/packages-17.01/mipsel_24kc/base" >> /etc/opkg/customfeeds.conf opkg update opkg install curl
We have quite a bit of content on cross-compilation that should make your life easier:
- Documentation article: https://docs.onion.io/omega2-docs/cross-compiling.html
- Video tutorial: https://www.youtube.com/watch?v=VOs75UsGe_o
- Article series detailing how to cross compile:
- Setting up the Build system: https://onion.io/2bt-cross-compiling-c-programs-part-1/
- Cross Compiling Programs: https://onion.io/2bt-cross-compiling-programs/
- Cross Compiling Programs that use External Libraries: https://onion.io/2bt-cross-compiling-c-programs-part-3/
The jist of it is that you'll need to use the Build System to do your cross compiling. If you need a separate library for your program, it will first have to be built by the build system before you can include it in your program.