I am having difficulty figuring out the include and library paths to compile hello.cpp with cross-toolchain arm-linux-gnueabihf installed via 'sudo apt-get install gcc-arm-linux-gnueabihf' on Ubuntu 14.04 PC
I can set up Eclipse (Luna) to build hello.c, but not hello.cpp
hello.c search paths:
Cross-tools path: /usr/bin
tools prefix: arm-linux-gnueabihf-
compilergcc
linker gcc
assembler as
include /usr/arm-linux-gnueabihf/include
libraries /usr/arm-linux-gnueabihf/lib
hello.cpp search paths:
Cross-tools path: /usr/bin
tools prefix: arm-linux-gnueabihf-
compilercpp
linker cpp
assembler as
include /usr/arm-linux-gnueabihf/include
libraries /usr/arm-linux-gnueabihf/lib
Build Output (-v): 21:14:27 **** Build of configuration Debug for project rockchip_hello **** make all Building file: ../src/rockchip_hello.cpp Invoking: Cross G++ Compiler arm-linux-gnueabihf-cpp -I/usr/arm-linux-gnueabihf/include -O0 -g3 -Wall -fmessage-length=0 -print-prog-name=cc1plus -v -MMD -MP -MF"src/rockchip_hello.d" -MT"src/rockchip_hello.d" -o "src/rockchip_hello.o" "../src/rockchip_hello.cpp" Using built-in specs. cc1plus COLLECT_GCC=arm-linux-gnueabihf-cpp Finished building: ../src/rockchip_hello.cpp
Building target: rockchip_hello Invoking: Cross G++ Linker arm-linux-gnueabihf-cpp -L/usr/arm-linux-gnueabihf/lib -o "rockchip_hello" ./src/rockchip_hello.o arm-linux-gnueabihf-cpp: error: ./src/rockchip_hello.o: No such file or directory arm-linux-gnueabihf-cpp: warning: ‘-x c’ after last input file has no effect arm-linux-gnueabihf-cpp: fatal error: no input files compilation terminated. make: *** [rockchip_hello] Error 4
21:14:27 Build Finished (took 65ms)
On 12/17/2014 12:23 AM, Bob Furber wrote:
hello.cpp search paths:
Cross-tools path: /usr/bin
tools prefix: arm-linux-gnueabihf-
compilercpp
linker cpp
cpp is the suffix for the C preprocessor. Try g++ instead.
HTH, Chris
Thanks Chris,
I searched my Ubuntu 14.04 PC for arm-linux-gnueabihf-g++ without success. I believe 'cpp' is another acronym for 'C-plus-plus'.
The reason I believe '/usr/bin/arm-linux-gnueabihf-cpp' is the right [symlink to] the C++ compiler is because, when I enter '/usr/include/c++/4.8' as the include search path, the compiler stops complaining about ' <iostream> unresolved inclusion'. However, it still complains about 'cout' and 'endln' being 'symbol could not be resolved' .
What worries me is this include path is unrelated to arm-linux-gnueabihf. It pre-dates its installation.
Likewise, when I search /usr/ for 'istream' & 'iostream', I can only find files that pre-date the installation of gcc-arm-linux-gnueabihf.
Could it be that the ' sudo apt-get install gcc-arm-linux-gnueabihf' installation is missing the C++ libraries and includes?
BobF
On 14-12-17 09:33 AM, Christopher Covington wrote:
On 12/17/2014 12:23 AM, Bob Furber wrote:
hello.cpp search paths:
Cross-tools path: /usr/bin
tools prefix: arm-linux-gnueabihf-
compilercpp
linker cpp
cpp is the suffix for the C preprocessor. Try g++ instead.
HTH, Chris
Hola,
2014-12-17 19:16 GMT+01:00 Bob Furber bob.furber@shaw.ca:
I searched my Ubuntu 14.04 PC for arm-linux-gnueabihf-g++ without success. I believe 'cpp' is another acronym for 'C-plus-plus'.
Not really, `cpp' stands for GNU C *preprocessor*
Could it be that the ' sudo apt-get install gcc-arm-linux-gnueabihf' installation is missing the C++ libraries and includes?
You probably want to install `g++-arm-linux-gnueabihf' package.
Regards,