2 Replies Latest reply on Mar 23, 2015 1:42 PM by mike_iot

    Tutorial for setting up a Linux environment for cmd line cross compilation

    mike_iot

      I’m struggling to setup an environment for cross compiling through command line on Linux. Using Eclipse it works, using the command line it gives the following error:

       

      mikl@linux-ntcz:~/Dev/test1> i586-poky-linux-g++ hello.cpp -v

      Using built-in specs.

      COLLECT_GCC=i586-poky-linux-g++

      COLLECT_LTO_WRAPPER=/opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/../lib/gcc/gcc/i586-poky-linux/4.8.2/lto-wrapper

      Target: i586-poky-linux

      Configured with: /silver/galileo/devkit/build-devkit-16/tmp/work-shared/gcc-4.8.2-r0/gcc-4.8.2/configure --build=x86_64-linux --host=i586-poky-linux --target=i586-poky-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib/gcc --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/silver/galileo/devkit/build-devkit-16/tmp/sysroots/quark --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=i586-poky-linux- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-sysroot=/ --with-build-sysroot=/silver/galileo/devkit/build-devkit-16/tmp/sysroots/quark --with-native-system-header-dir=/silver/galileo/devkit/build-devkit-16/tmp/sysroots/quark/usr/include --with-gxx-include-dir=/usr/include/c++/ --enable-targets=all --enable-nls --enable-__cxa_atexit

      Thread model: posix

      gcc version 4.8.2 (GCC)

      COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=pentium' '-march=pentium'

      /opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/../lib/gcc/gcc/i586-poky-linux/4.8.2/cc1plus -quiet -v -iprefix /opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/../lib/gcc/i586-poky-linux/4.8.2/ -D_GNU_SOURCE hello.cpp -quiet -dumpbase hello.cpp -mtune=pentium -march=pentium -auxbase hello -version -o /tmp/ccjbg4lq.s

      /opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/../lib/gcc/gcc/i586-poky-linux/4.8.2/cc1plus: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory

       

      the shared library is in the directory /opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/usr/lib

       

      LD_LIBRARY_PATH="/opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/usr/lib:/opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/usr/lib32:/opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/usr/lib:/opt/iotdk-ide-linux/devkit-x86/sysroots/i586-poky-linux/usr/bin/usr/lib32:"

       

      Any ideas? Is there a tutorial for setting up a command line environment for cross compilation?

       

      Thanks

      Mike