0

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

Mohy Fahim
  • 49
  • 9
  • 2
    When posting questions about build errors, please include the actual errors in the question body. Please edit your question to include the errors, as text, copy-pasted, in full, complete, including possible informational notes and without modifications. – Some programmer dude Aug 30 '17 at 08:02
  • And you get the errors when *building*? It's not errors from Eclipse itself? Because the Eclipse symbol database is only rebuilt when you build your application. – Some programmer dude Aug 30 '17 at 08:12
  • @Someprogrammerdude when i push 'build' Button , it happend and in console window : 12:12:08 **** Incremental Build of configuration Debug for project hi **** make all make: Nothing to be done for 'all'. 12:12:08 Build Finished (took 91ms) – Mohy Fahim Aug 30 '17 at 08:16
  • Just a suggestion, since you are ready to dive into BeagleBoards, why not use a linux based OS ? that would make all this process much much more simpler. – zeekhuge Aug 30 '17 at 12:12
  • @ZeekHuge Yup, I agree with you. This is what I have to do ... – Mohy Fahim Aug 30 '17 at 12:55

0 Answers0