4 Replies Latest reply on Dec 12, 2016 5:05 PM by Intel Corporation

    Building and running C++ programs from the command line

    Sarir

      I seem to be able to build C++ programs from the command line (on the Joule 570) with something like this

       

      g++ -pthread -Wall -Wextra -pedantic -ansi -std=c++1y -ggdb -m64 --sysroot= -m64 -march=corei7 -I/usr/include/upm -I/usr/include/mraa -c myProg.cpp

      # other stuff trimmed

      g++ objectFiles.o -o myProg -lmraa -lpthread

       

      but when I run and try to use the SPI I get

       

      $ ./myProg
      Error initialising SPI bus

       

      This seems to work fine from Eclipse under Ubuntu using that system. Any ideas what's missing from the command line to get programs to work?

       

      I'm running these versions

       

      $ uname -a
      Linux intel-corei7-64 4.4.15-yocto-standard #1 SMP PREEMPT Fri Aug 12 22:04:24 UTC 2016 x86_64 GNU/Linux

      $ mraa-gpio version
      Version v1.5.1-1-gd043faf on Intel GT Tuchuck

       

      Thanks.