Eclipse ARM mbed cannot move location counter backward error - eclipse

while I was following this tutorial
https://developer.mbed.org/cookbook/eclipse-for-building-and-debugging
I run on a error building the project on Eclipse (I followed all the steps untill the first build project at which point I received the following error):
../../external/mbed/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U24_401/LPC11U24.ld:50 cannot move location counter backwards (from 00000238 to 00000200) collect2: error: ld returned 1 exit status make: *** [LPC11U24/FileTest.elf] Error 1
Since ld is involved I think the problem is related to the linker but I have no clue what to do and where to look at. I'm working in Debian 32 bit and Eclipse LUNA.

I found the problem, I selected the wrong toolchain: linux gcc instead of cross gcc.

Related

How to fix Xcode linker command ld emulation error message issue?

So in the process of trying to find a way to offset my c program in the linking phase to 0x1000 for the standard kernel loading spot, I downloaded binutils from GNU (myself, not through Homebrew), which seems to have created a tricky error. When I invoke ld in Terminal, I get this error message(yes the blanks are what's displayed):
ld: unrecognised emulation mode:
Supported emulations:
Even after going through each directory in binutils and make uninstalling each, and removing and then redownloading Xcode CommandLineTools, the issue persists. I'm a bit lost- any ideas? Thank you!
Forgot to mention, I noticed ld wasn't included in the initial download of binutils, and downloaded it seperately through the ld directory of binutils. This was before I saw that GNU doesn't support Darwin for ld unless its installed as a cross-linker, yet it still ended up on my system somehow (I didn't install it as a corss-linker). I uninstalled ld along with all the other binutil functions.

Encountered an error while compiling cobalt on raspberry pi

While compiling cobalt for raspberry pi on ninja, im getting an error like this:
undefined reference to symbol 'eglCreateImageKHR'
here is the full trace:
[1/1] LINK cobalt
FAILED: cobalt
/home/mi07/work/raspitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ #cobalt.rsp
/home/mi07/work/raspitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: obj/starboard/raspi/2/../shared/open_max/starboard_platform.decode_target_create.o: undefined reference to symbol 'eglCreateImageKHR'
/home/mi07/work/raspitools/sysroot/opt/vc/lib/libbrcmEGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I googled it and found somewhat related article on this site.
As per this article the fault could be that of libssl1.0-dev not being there. I checked and found it was libssl-dev. Replaced it with libssl1.0-dev but still the error persists.
Can somebody tell me what is going wrong?
eglCreateImageKHR() is an EGL extension EGL_KHR_image. Since Cobalt compiled, it appears the headers declare the extension, but the linked EGL library didn't define it. It's surprising that only eglCreateImageKHR() is missing and not eglDestroyImageKHR as well.
At any rate, I recommend trying to update the EGL library, but I'm not familiar with the raspi install, so can't tell you the specifics.
Alternatively, it is safe to comment out the call to that function in decode_target_create.cc since SbImageIsDecodeSupported() always returns false for raspi (see image_is_decode_supported.cc), so decode targets should never be created / destroyed on the platform. (Decode target support is a work in progress for raspi.)
I resolved this by changing the os itself. The problem was that the cobalt was not compatible with raspi stretch but with raspi jessie. Because sysroot files are being copied from the OS it was creating that error. I don't know exactly where the difference is but changing to raspi jessie worked fine for me.

cross compiling opencv with eclipse in ubuntu

I am able to cross compile hello world program in raspberry pi from my Ubuntu 14.04 PC through eclipse. But I am not able to cross compile opencv programs. I am getting following error:
15:19:20 ** Incremental Build of configuration Debug for project MyFirstRaspProg **
make all
Building target: MyFirstRaspProg
Invoking: Cross G++ Linker
arm-linux-gnueabi-g++ -L/home/tvsm/raspberry -L/usr/lib/gcc-cross/arm-linux-gnueabi/4.7 -L/usr/lib/i386-linux-gnu/lib -L/usr/arm-linux-gnueabi/lib -o "MyFirstRaspProg" ./src/MyFirstRaspProg.o -lopencv_highgui
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lopencv_highgui
collect2: error: ld returned 1 exit status
make: * [MyFirstRaspProg] Error 1
15:19:20 Build Finished (took 56ms)
Can anyone help how to resolve this?
The error is because you have specified arm-linux-gnueabi-g++ to refer a library, which is not available. So you need to cross compile the necessary library for ARM platform and link it during build.
Follow the below link to cross compile the opencv on Ubuntu machine.
http://www.ridgesolutions.ie/index.php/2013/05/24/building-cross-compiling-opencv-for-linux-arm/
You will be left with an "install" folder at the end of the process.
In eclipse specify the library path and include path to "lib" & "include" folders in the "install" folder respectively.

Undefined referece to Function for OpenSSl app in Eclipse

Hi am new to eclipse IDE and OpenSSL . It shows the error called cannot open lib files and Undefined referece to (Function). Can anybody give me suggestion for adding the correct path for the application am trying from last few days am stuck with it.......
the error look like this Build Error
Build of configuration Debug for project R&D **
Internal Builder is used for build **
gcc -LD:\source codes\openssl\lib -oR&D.exe openssl\applink.o main.o
main.o: In function main':
D:\c&c++programs\R&D\Debug/../main.c:53: undefined reference toRAND_pseudo_bytes'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 331 ms.
one more thing am using the MinGW as my compiler for Eclipse.It is a C & C++ application
... am new to eclipse IDE and OpenSSL...
You must add OpenSSL to the project.
First, OpenSSL includes must be added:
Second, the OpenSSL libraries must be added:

Executing cuda program through Eclipse is giving error

I am using eclipse to execute a cuda program. I have downloaded a CUDA PLUGIN for
eclipse. When I execute sample cuda program given by plugin its fine but when I try
to execute any other program I am getting error undefined reference to main...
make
Building target: Add_cuda
Invoking: NVCC Linker
nvcc -L/export/trainee3/dinesh/cuda5.0/lib64 -o "Add_cuda" ./mycuda.o -lcudart
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
I found in stackoverflow that some times we get this problem because of system startup file
I used flag -nostartfiles but it is not working in my case..
I have included lib64 and include path in c++ build.
So any suggestion to over come this problem....
We've been over this already.
Use nsight eclipse edition instead.
If you have cuda 5.0 or 5.5 installed, just type nsight in a terminal session.
If you really want to use that Eclipse CUDA plugin (which is no longer supported, I don't believe), then start with the C++ sample project, which you agree now and back then would work. Then modify the source code in that project. Don't create your own project.
Install CUDA 5. It comes with Nsight Eclipse version. Very Elegant to use. NV Visual profiler is integrated with Nsight. Syntax highlighting and debug mode are very easy to use.