I'm currently working on a project with a Reach M+ (which is a GPS combine to an IMU). This device works with a light Linux version on a ARM processor. With this Linux version, I don't have "apt-get", "nano", etc. so I have to compile my program with a laptop (running on the latest Ubuntu release). My program has to do:
1- Collect data from the IMU.
2- Write these data into a file.
3- Compress the file every hour (So I create a new file per hour).
My program works well until the compression has to be done. So I reduce the size of my code and here is a simply code where I only try the thread:
using namespace std; // Standard librairy
cout << "hello" << endl;
So when I run that code, I receive this error (the error number is random):
root@reach:~/6- Test thread# ./reach
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -140905776 Aborted (core dumped)
Here is my Makefile:
CXX = arm-linux-gnueabi-g++
CXXFLAGS = -Wall -O
CXXFLAGS += -lpthread
CXXFLAGS += -static
EXEC = reach
OBJ = src/main.o
$(LINK.cpp) $^ -o $@ $(CXXFLAGS)
$(RM) *~ $(OBJ)
I had to add "-static" because if this option is not selected, the reach can't run the program (-sh: ./reach: No such file or directory).
I tried to use gdb to debug my program but I can't install it on the Reach. How can I solve this problem ?