Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Building from CLI works but not from IDE itself(make from cli builds project but Build, or Ctrl-B, within IDE fails with fatal error)
Building from CLI works but not from IDE itself [message #1793593] Fri, 10 August 2018 19:08 Go to next message
Stephen Crawford is currently offline Stephen CrawfordFriend
Messages: 1
Registered: August 2018
Location: Rhode Island, USA
Junior Member
Hello all,

I am having what seems an illogical problem when building an ARM(Beaglebone Black) project. The quick summary is that when building within the IDE the build ends with a fatal error "selected target format 'elf32-littlearm' unknown", however if I open up a terminal and change into the release or debug directory of the project and enter 'make' on the CLI the project builds fine and the executable will run on the BB. Why would I be able to build within the terminal but it fails within the IDE? Isn't the same 'make' sequence followed by both?

System details in case needed....

  • Gentoo Linux
  • ARM cross development system installed via crossdev and successfully tested (applicable gcc executes with version and details)
  • Have entered the correct prefix/path in Project->C/C++ Build->Settings->Tool Settings->Cross Settings ('arm-linux-gnueabihf-' and '/usr/x86_64-pc-linux-gnu/arm-linux-gnueabihf/gcc-bin/7.3.0'


The project is just your 'standard' Hello World type program....
#include <iostream>
using namespace std;

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}


The outputs during build show (enabled verbose output for troubleshooting this)....
From within the IDE....

14:38:08 **** Build of configuration Release for project HelloWorldBBB ****
make all 
Building file: ../src/HelloWorldBBB.cpp
Invoking: Cross G++ Compiler
arm-linux-gnueabihf-g++ -I/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -O3 -Wall -c -fmessage-length=0 -v -MMD -MP -MF"src/HelloWorldBBB.d" -MT"src/HelloWorldBBB.o" -o "src/HelloWorldBBB.o" "../src/HelloWorldBBB.cpp"
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-g++
Target: arm-linux-gnueabihf
Configured with: /var/tmp/portage/cross-arm-linux-gnueabihf/gcc-7.3.0-r3/work/gcc-7.3.0/configure --host=x86_64-pc-linux-gnu --target=arm-linux-gnueabihf --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/arm-linux-gnueabihf/gcc-bin/7.3.0 --includedir=/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include --datadir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0 --mandir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0/man --infodir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0/info --with-gxx-include-dir=/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 --with-python-dir=/share/gcc-data/arm-linux-gnueabihf/7.3.0/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --enable-checking=release --with-bugurl=hxxps://bugs.gentoo.org/ --with-pkgversion='Gentoo 7.3.0-r3 p1.4' --disable-esp --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/arm-linux-gnueabihf --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --with-float=hard --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --disable-libquadmath --enable-lto --without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.3.0 (Gentoo 7.3.0-r3 p1.4) 
COLLECT_GCC_OPTIONS='-I' '/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7' '-O3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'src/HelloWorldBBB.d' '-MT' 'src/HelloWorldBBB.o' '-o' 'src/HelloWorldBBB.o' '-shared-libgcc' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-linux-gnueabihf/7.3.0/cc1plus -quiet -v -I /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -MMD src/HelloWorldBBB.d -MF src/HelloWorldBBB.d -MP -MT src/HelloWorldBBB.o -D_GNU_SOURCE ../src/HelloWorldBBB.cpp -quiet -dumpbase HelloWorldBBB.cpp -mfloat-abi=hard -mtls-dialect=gnu -auxbase-strip src/HelloWorldBBB.o -O3 -Wall -version -fmessage-length=0 -o /tmp/ccY1iHiD.s
GNU C++14 (Gentoo 7.3.0-r3 p1.4) version 7.3.0 (arm-linux-gnueabihf)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7/arm-linux-gnueabihf
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7/backward
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include
 /usr/arm-linux-gnueabihf/usr/local/include
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include-fixed
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/../../../../arm-linux-gnueabihf/include
 /usr/arm-linux-gnueabihf/usr/include
End of search list.
GNU C++14 (Gentoo 7.3.0-r3 p1.4) version 7.3.0 (arm-linux-gnueabihf)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9ca33c17c4a376da20c4d4b41ecfd6a9
COLLECT_GCC_OPTIONS='-I' '/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7' '-O3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'src/HelloWorldBBB.d' '-MT' 'src/HelloWorldBBB.o' '-o' 'src/HelloWorldBBB.o' '-shared-libgcc' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-linux-gnueabihf/as -v -I /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -mfloat-abi=hard -meabi=5 -o src/HelloWorldBBB.o /tmp/ccY1iHiD.s
GNU assembler version 2.30.0 (arm-linux-gnueabihf) using BFD version (Gentoo 2.30 p2) 2.30.0
Assembler messages:
Fatal error: selected target format 'elf32-littlearm' unknown
make: *** [src/subdir.mk:20: src/HelloWorldBBB.o] Error 1


and

From the CLI in a terminal

Building file: ../src/HelloWorldBBB.cpp
Invoking: Cross G++ Compiler
arm-linux-gnueabihf-g++ -I/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -O3 -Wall -c -fmessage-length=0 -v -MMD -MP -MF"src/HelloWorldBBB.d" -MT"src/HelloWorldBBB.o" -o "src/HelloWorldBBB.o" "../src/HelloWorldBBB.cpp"
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-g++
Target: arm-linux-gnueabihf
Configured with: /var/tmp/portage/cross-arm-linux-gnueabihf/gcc-7.3.0-r3/work/gcc-7.3.0/configure --host=x86_64-pc-linux-gnu --target=arm-linux-gnueabihf --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/arm-linux-gnueabihf/gcc-bin/7.3.0 --includedir=/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include --datadir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0 --mandir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0/man --infodir=/usr/share/gcc-data/arm-linux-gnueabihf/7.3.0/info --with-gxx-include-dir=/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 --with-python-dir=/share/gcc-data/arm-linux-gnueabihf/7.3.0/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --enable-checking=release --with-bugurl=hxxps://bugs.gentoo.org/ --with-pkgversion='Gentoo 7.3.0-r3 p1.4' --disable-esp --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/arm-linux-gnueabihf --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-altivec --disable-fixed-point --with-float=hard --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --disable-libquadmath --enable-lto --without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.3.0 (Gentoo 7.3.0-r3 p1.4) 
COLLECT_GCC_OPTIONS='-I' '/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7' '-O3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'src/HelloWorldBBB.d' '-MT' 'src/HelloWorldBBB.o' '-o' 'src/HelloWorldBBB.o' '-shared-libgcc' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-linux-gnueabihf/7.3.0/cc1plus -quiet -v -I /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -MMD src/HelloWorldBBB.d -MF src/HelloWorldBBB.d -MP -MT src/HelloWorldBBB.o -D_GNU_SOURCE ../src/HelloWorldBBB.cpp -quiet -dumpbase HelloWorldBBB.cpp -mfloat-abi=hard -mtls-dialect=gnu -auxbase-strip src/HelloWorldBBB.o -O3 -Wall -version -fmessage-length=0 -o /tmp/ccfMKoY7.s
GNU C++14 (Gentoo 7.3.0-r3 p1.4) version 7.3.0 (arm-linux-gnueabihf)
        compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7                                                                                                                                                                                                            
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7/arm-linux-gnueabihf                                                                                                                                                                                        
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7/backward                                                                                                                                                                                                   
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include                                                                                                                                                                                                                   
 /usr/arm-linux-gnueabihf/usr/local/include                                                                                                                                                                                                                       
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include-fixed                                                                                                                                                                                                             
 /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/../../../../arm-linux-gnueabihf/include                                                                                                                                                                                   
 /usr/arm-linux-gnueabihf/usr/include                                                                                                                                                                                                                             
End of search list.                                                                                                                                                                                                                                               
GNU C++14 (Gentoo 7.3.0-r3 p1.4) version 7.3.0 (arm-linux-gnueabihf)                                                                                                                                                                                              
        compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version none                                                                                                                                               
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072                                                                                                                                                                                        
Compiler executable checksum: 9ca33c17c4a376da20c4d4b41ecfd6a9                                                                                                                                                                                                    
COLLECT_GCC_OPTIONS='-I' '/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7' '-O3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'src/HelloWorldBBB.d' '-MT' 'src/HelloWorldBBB.o' '-o' 'src/HelloWorldBBB.o' '-shared-libgcc' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-linux-gnueabihf/as -v -I /usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7 -mfloat-abi=hard -meabi=5 -o src/HelloWorldBBB.o /tmp/ccfMKoY7.s
GNU assembler version 2.30.0 (arm-linux-gnueabihf) using BFD version (Gentoo 2.30 p2) 2.30.0
COMPILER_PATH=/usr/libexec/gcc/arm-linux-gnueabihf/7.3.0/:/usr/libexec/gcc/arm-linux-gnueabihf/7.3.0/:/usr/libexec/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/:/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/../../../../arm-linux-gnueabihf/lib/:/usr/arm-linux-gnueabihf/lib/:/usr/arm-linux-gnueabihf/usr/lib/
COLLECT_GCC_OPTIONS='-I' '/usr/lib/gcc/arm-linux-gnueabihf/7.3.0/include/g++-v7' '-O3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'src/HelloWorldBBB.d' '-MT' 'src/HelloWorldBBB.o' '-o' 'src/HelloWorldBBB.o' '-shared-libgcc' '-mfloat-abi=hard' '-mtls-dialect=gnu'
Finished building: ../src/HelloWorldBBB.cpp
 
Building target: HelloWorldBBB
Invoking: Cross G++ Linker
arm-linux-gnueabihf-g++ -L/usr/arm-linux-gnueabihf/lib -o "HelloWorldBBB"  ./src/HelloWorldBBB.o   
Finished building target: HelloWorldBBB
 


and for what it's worth noting I can build native projects fine on my development system.

Searching forums and general search on Google shows lots of Q&A on builds failing but they are all about builds not compiling or linking or both etc, I can't find anything about why it would build from the CLI and not the IDE. This is more of a PITA issue as the obvious workaround is to just always build from the CLI but I shouldn't have to rely on a workaround.

Thanks in advance for any help/guidance.
Re: Building from CLI works but not from IDE itself [message #1794119 is a reply to message #1793593] Thu, 23 August 2018 23:18 Go to previous message
Andrew Robinson is currently offline Andrew RobinsonFriend
Messages: 2
Registered: August 2018
Junior Member
I am not sure the hint I have is the answer you need; but I also run gentoo. Cross compilers rely on environment/profile variables, set at login. When you launch your IDE, it may launch with a different environment because of how it is installed / related to your window manager and user directory. You might want to have "make" dump the environent variables to a file when run from the command line, and then save the file. After running the IDE, and running make, you can compare the environment variables and path variables. IF they differ, then a mising environment variable or profile, may be the problem.
Previous Topic:Launch failed. Binary not found.
Next Topic:Debug fails with cygwin in Eclipce, but program runs successfully
Goto Forum:
  


Current Time: Fri Nov 16 18:26:23 GMT 2018

Powered by FUDForum. Page generated in 0.01422 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top