Okay it's all clear now, then when I build I think I have to transfer the executable and run it in the omega's terminal, it seems work when I try this
Then I will try to finish my project without OLED libraries, thank you so much!
Okay it's all clear now, then when I build I think I have to transfer the executable and run it in the omega's terminal, it seems work when I try this
Then I will try to finish my project without OLED libraries, thank you so much!
Oh thank you this works and it's very powerful! Thank you so much!
I have just some other questions I hope you can ask...
This NetBeans setup is the same as cross-compiling for omega? Means that I can run server programs binding to Omega's IP and the omega will run a tcp server?
Another question, I tried all the combinations possible, but seems that the libonionoledexp.so can't work, I combined it with liboniondebug and libonion12c as it's suggested in documentation, and I also configured the project properties (now in compilation line the flags -l<lib> are added).. Did you use that library too?
Hey @crispyoz I'm sorry I didn't thanked you, now I'm using the Omega2+ for some projects with threads and semaphores and I wanted ask you how to add the flag -lpthread in linking (because I think it's for this that the run command gives me error in make)
@crispyoz
Okay I did all these things and I tried to build the project:
The libraries I included are:
-libonionoledexp.so
-libonioni2c.so
-liboniondebug.so
Same problem
Maybe do I need to compile another time the toolchain?
also searching "oled" no matches found
Thank you I'm trying now but seems that the libonionoledexp isn't installed, this is the screen:
Okay @crispyoz thank you very much, I installed successfully Netbeans and seems to be working in the right way.
I need some other tips also because it's the first time I use a tool like this (to compile simple programs I had only textedit and the terminal).
Now I created my C project and in my source folder I have the main, for example a program to display "hello world" on the OLED screen of the omega.
How can I link the oled C libraries in the cross-compilation with NetBeans? Do I have to download them or are stored in the usr/lib folder ?
Thank you another time
Ye I found also this.
In my netbeans I see this and then I search tools and I get the last screen I posted.
@crispyoz
Thank you,
I'm trying to setup netbeans, but when I open 'tools' in the c/c++ I have a different screen:
I Need to setup a ccls configuration (?)
I tried Also a lot to crosscompile my c programs with the Onion's tutorial, but I noticed that also the c-cross-compile-example with gpioRead fails in compilation:
makefile:9: recipe for target 'gpioRead' failed
make *** [gpioRead] Error 127
Do you know if cross compilation is the only method to use the OLED expansion C libraries?
Okay I compiled successfully hello wolrd, now the problem is when I link external libraries..
I linked with this syntax:
root@229a08e06724:~/source/projects/c-cross-compile-example# sh xCompile.sh -buildroot /root/source -lib "oled-exp -ludpsocketlib"
the library I want to use is my own "udpsocketlib.c" and the header file is "udpsocketlib.h" (all in the same directory with makefile and the main of my udpserver.c program
The error I got this time is this:
make: /root/source/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin/mipsel-openwrt-linux-gcc: Command not found
makefile:9: recipe for target 'udpserver' failed
make: *** [udpserver] Error 127
Thank you, I tried with sudo and then the command:
this is what i get:
sudo: /root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc: command not found
Is there an error with the installation of the toolchain?
Okay thank you, I solved the problem and the make went good, but going on with my cross compilation:
I wrote the file hello.c
*#include‹stdio.h›
int main()
{
printf("Hello World\n");
printf("We are running a cross-compiled C program on the Omega2!\n");
return(0);
}*
I used this to cross compile (as written in the Onion guide):
/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc hello.c -o hello
The error I got is:
bash: /root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc: Permission denied
I'm on architecture amd64 and the os is linux ubuntu 20.04
Can you help me? Thx
Hi all,
I'm really new in this world and I'm moving my first steps with the omega2, the hardware I'm trying to use is: Omega2+, Expansion Dock, OLED display
First thing I followed the guide First Time Setup, and all went good
Then I followed the Cross Compiling Guide step by step
I downloaded the Docker for Linux Ubuntu 20.04 selecting focal --> pool --> stable ---> amd64
and, unfortunately, I had a problem in the step:
docker pull onion/omega2-source
The error I got is the following:
Using default tag: latest
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=onion%2Fomega2-source&tag=latest: dial unix /var/run/docker.sock: connect: permission denied
Can someone help me? Thank you very much
EDIT:
I solved this problem, but running the last command
make
i'm getting this error:
Collecting package info: done
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'Onion-Console', which does not exist
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'transmission-daemon', which does not exist
WARNING: Makefile 'package/feeds/onion/zeromq/Makefile' has a build dependency on 'libuuid', which does not exist
make[2]: Entering directory '/root/source/scripts/config'
conf.c: In function 'check_stdin':
conf.c:78:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_("aborted!\n\n"));
^~~~~~
conf.c:79:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_("Console input/output is redirected. "));
^~~~~~
conf.c:80:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_("Run 'make oldconfig' to update configuration.\n\n"));
^~~~~~
conf.c: In function 'conf_askvalue':
conf.c:90:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_("(NEW) "));
^~~~~~
conf.c: In function 'conf_choice':
conf.c:291:5: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_(" (NEW)"));
^~~~~~
conf.c: In function 'check_conf':
conf.c:439:6: warning: format not a string literal and no format arguments [-Wformat-security]
printf(_("\n* Restart config...\n*\n"));
^~~~~~
conf.c: In function 'main':
conf.c:620:6: warning: format not a string literal and no format arguments [-Wformat-security]
_("\n*** The configuration requires explicit update.\n\n"));
^
conf.c:674:4: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
^~~~~~~
conf.c:678:4: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
^~~~~~~
conf.c:689:4: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
^~~~~~~
make[2]: Leaving directory '/root/source/scripts/config'
time: target/linux/prereq#0.09#0.01#0.10
Checking 'rsync'... ok.
WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!
make[1] world
make[2] tools/compile
make[3] -C tools/flock compile
make[3] -C tools/sed compile
make[3] -C tools/patch compile
make[3] -C tools/xz compile
make[3] -C tools/tar compile*