mbats/eclipse-buildroot-bundle

Error while compilation on eclipse

avinash386 opened this issue · 8 comments

Hi,

I have installed buildroot on my beaglebone and updated it with the toolchain you have provided.
But i have an issue with the compilation.

Error is as follows:
home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/glibc.git~release-2.21-master/csu/../sysdeps/arm/start.S:119: undefined reference to `main'

@avinash386 Without the source code of your application, it's impossible to tell. But according to the error message, it seems like you're trying to link an executable, but there is no main() function defined anywhere.

I was just implementing a sample of hello world.
Below is the code
#include <stdio.h>

int main(void)
{
printf("Hello world\n");
return 0;
}

Another thing is that the toolchain you're using doesn't seem be a Buildroot toolchain. Can you share more details about your Buildroot version and Buildroot configuration (post your complete Buildroot .config file somewhere) ?

Also, can you try to compile your application manually (outside of Eclipse), by doing ./output/host/usr/bin/ARCH-gcc -o test test.c, where test.c is your application source code?

Thanks a lot tpetazzoni,

I am using arm board. I have compiled the gcc binary of arm which is listed in the folder as arm-linux-gnueabihf-gcc and it was a success. But unfortunately it is not working on eclipse. I will try to port it on to the board and check if it is working on the hardware.

For your reference i have uploaded the config file on to dropbox. Link is as mentioned below:
https://www.dropbox.com/s/1is9cpun0p04ru0/config_git?dl=0

OK. Please copy paste here the entire build output visible in the Eclipse console, so that we can analyze what's going on.

make all
Building target: test
Invoking: Cross GCC Linker
arm-linux-gnueabihf-gcc -o "test" ./src/test.o
/home/achilies/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/crt1.o: In function _start': /home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/glibc.git~release-2.21-master/csu/../sysdeps/arm/start.S:119: undefined reference tomain'
makefile:30: recipe for target 'test' failed
collect2: error: ld returned 1 exit status
make: *** [test] Error 1

The issue is solved by installing the arm library from sudo apt-get install operation. Thanks a lot for the help !!

Hi Avinash
I am facing the same issue. Could you explain which arm library needs to be installed or how to go about finding which arm library needs to be installed ? Any help would be much appreciated.