c++ cross compiler for beaglebone black

1.1k views Asked by At

I'm trying to compile a c++ program on windows 10 for beaglebone black by cross toolchain gcc-linaro-5.4.1-2017.05-i686-mingw32_arm-linux-gnueabihf.tar.xz and Eclipse for DS-5 CE v 5.27.0 IDE, according to this video on youtube. in that video, after installation IDE and extract the toolchain and giving the toolchain's path to the IDE, I compiled a simple hello world c++ code and sent it to BBB via SSH, but here is my problem : when I want to compile a code that uses GPIOs in my code, like this :

#include<iostream>
#include<fstream>
#include<string>
using namespace std;

int main(){
   std::fstream fs;

   fs.open("/sys/kernel/debug/omap_mux/gpmc_ad4");
   fs << "7";
   fs.close();
   fs.open("/sys/class/gpio/export");
   fs << "32";
   fs.close();
   fs.open("/sys/class/gpio/gpio32/direction");
   fs << "out";
   fs.close();
   fs.open("/sys/class/gpio/gpio32/value");
   fs << "1"; // "0" for off
   fs.close();
   // select whether it is on, off or flash

   return 0;
}

it gives me an error that says: Method 'close' could not be resolved and also gives this for Method 'open'.

The error: enter image description here

I compiled this code with Dev c++ and it worked but I want to compile it with the cross-compiler for my BBB.

please help me

0

There are 0 answers