Havin' some problems linking


Loonie

Active Member
Joined
Apr 1, 2003
Messages
753
Hi all,


I've been setting up my dev environment to stat making some Pandora stuff, but I've hit an obstacle. Note: I am working in Windows (*spit, spit*)


I've set up the toolchain from the Code Sourcery site (I'm using arm-2011.09\arm-none-linux-gnueabi), I've grabbed the additional Pandora/Amstrong stuff and had a go at compiling my simple SDL test stuff that I can compile on Dingoo (Dingux) and Windows. Everything seems to compile, I'm just hitting a problem with linking.


To make things even simpler, I knocked up a "hello world" type thing:



Code:
#include <stdio.h>

int main()

{

printf ("Whoops Mrs. Miggins, you're sitting on my artichokes!");

return 0;

}


but I'm still hitting the same error. At the linking stage, it announces:

c:/dev/pandora/arm-2011.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld.exe: cannot find /lib/libc.so.6
c:/dev/pandora/arm-2011.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld.exe: cannot find /usr/lib/libc_nonshared.a


c:/dev/pandora/arm-2011.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld.exe: cannot find /lib/ld-linux.so.3


collect2: ld returned 1 exit status

I have even found a directory where these files reside and have provided the linker with a path to both the files themselves, and to the folder that would take it to the files in question with the path it was appending to the file (e.g. /usr/lib/libc_nonshared.a) but just no dice. It's finding all the SDL stuff quite happily, but I just can't get it past this point.


Any of you smarter, more experienced folk able to shed any light? Damn, so close...
 
Hmm... I'm not familiar with bash, but I think I get the gist of it.


If I'm understanding this, I need to go through all the *.la and *.pc files and adjust the path references according to that SEDCMD variable. I'll have a crack at that tomorrow. Thanks, sebt3.
 
Last edited by a moderator:
well that was for later.


for now have a look at your ...\usr\lib\libc.so and ...\usr\lib\libpthread.so and fixes thoses paths ;)
 
Two files, eh. That was certainly easier.


Well, now the linker throws out a ton of SDL errors, which is to be expected, as all the SDL-related .so files need modifying as well.


Amongst all the SDLstuff is one error which concerns me:



Code:
c:/dev/pandora/arm-2011.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld.exe: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux-eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-mingw32/bfd/elf32-arm.c:11463


Compiling the "hello world" program from above produces this error too.


Once I get all this working, I plan to prepare a little Windows app that can perform all the needed modifications.This error has me scratching my head somewhat though.


Edit: It seems one of the lib directories I had added was causing a problem. I've removed the lib directories that referenced the pandora local directory and the "hello world" example seems to compile now. I'll see if the resulting file runs on Pandora, then if it does, start workinh on the SDL side of things. If not, I'll cry or something.


Edit 2: Hmm... nothing seems to happen when I execute it. Perhaps I will try crying.


Edit 3: Decided to abandon the "hello world" app for now and compile a simple SDL test that just fills the pixels of the screen. The lib directory that was causing me the above error needs to be added for SDL to compile anyway, so I guess that error still applies.
 
Last edited by a moderator:
Not a direct answers, but post #4 onwards of this thread:


http://www.gp32x.de...ing-on-windows/


Explains the tool chain I use to build on Windows. My title, KAMI RETRO, which is available in the repository, was created using this tool chain.


At some point I'll try and put together an updated post about my Windows development environment, as I using JamPlus, which means it is all integrated into Visual Studio, clicking build does everything including making a PND (complete with exe and data), but I don't quite have the time right now. If you were particularly interested, my folk of JamPlus is available here: https://github.com/Scraft/jamplus and hopefully is mainly up to date..


Steve
 
Last edited by a moderator:
Thanks, I'll check that out. I've managed to get a functional toolchain together with some help from foxblock, but I still want to try to put one together from the latest libraries, so things can be nice and up-to-date.
 
Good luck with this. Sounds similar to the thing I ran into when I tried last year. Then ran out of time and haven't had time or motivation to look again yet (changed jobs)


I managed to get as far as a clean compile by hand editting paths in files I was using but when I transfered it to pandora it wasn't recognised as an executable. That just stumped me.


Here's the steps I went through.


http://www.gp32x.de/board/index.php?/topic/59350-help-getting-windows-toolchain-runningc-h-compile/page__p__947803
 
Last edited by a moderator:
Back
Top