mbats / eclipse-buildroot-bundle

Eclipse bundle to integrate useful tools for embedded Linux developpers
30 stars 17 forks source link

Error while compilation on eclipse #22

Closed avinash386 closed 8 years ago

avinash386 commented 8 years ago

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'

tpetazzoni commented 8 years ago

@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.

avinash386 commented 8 years ago

I was just implementing a sample of hello world. Below is the code

include

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

tpetazzoni commented 8 years ago

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?

avinash386 commented 8 years ago

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

tpetazzoni commented 8 years ago

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

avinash386 commented 8 years ago

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

avinash386 commented 8 years ago

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

shyamvnarayanan commented 7 years ago

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.