Libjpeg - In Libs Path But Not Found By Gcc


hornett

Still Fresh
Joined
Nov 30, 2006
Messages
7
Hello all :)

I'm trying to use the Gamepark Holdings Software Developer's Kit (as per this)

Previously my program built fine under the open2x toolchain, but would not run properly because of the differences between libc in the toolchain and on the gp2x (gethostbyname() requires exactly the same version on both)

Now using GPHSDK, I cannot even get it to build.

here is the error:
CODE
arm-gp2x-linux-g++ -static -o gpsdump.gpe gpsdump.o -L"/gp2xsdk/Tools/arm-gp2x-linux/lib/static/" -L"/gp2xsdk/Tools/arm-gp2x-linux/lib/" -lSDL --start-group -lSDL_ttf -lfreetype -lSDL --end-group -lSDL_image -ljpeg -lpng12 -lz -lSDL -lgcc -lm -lc -lpthread -ldl

/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/bin/ld: cannot find -ljpeg
collect2: ld returned 1 exit status


but libjpeg is there!
CODE
ls -l /gp2xsdk/Tools/arm-gp2x-linux/lib/ | grep jpeg
-rwxr-xr-x 1 root root 485 2006-01-03 12:20 libjpeg.la
lrwxrwxrwx 1 root root 17 2007-04-11 18:36 libjpeg.so -> libjpeg.so.62.0.0
lrwxrwxrwx 1 root root 17 2007-04-11 18:36 libjpeg.so.62 -> libjpeg.so.62.0.0
-rwxr-xr-x 1 root root 144490 2006-01-03 12:20 libjpeg.so.62.0.0



Somebody please tell me I've missed something really obvious! :) :blink:

PS, If I try to link dynamically, it tells me I must use software FPU emu, but using -msoft-float tells me "cannot find -lfloat"

Thanks

Andy
 
I'm a rank amateur at this game, so may not be too much help.

To me, I'd guess that it's looking in your normal compiler library directories and not finding them there.
 
Thanks Kagey

Do you have any SDL apps building with this toolchain then? I cannot even get a simple test program to build.

I think that the -L"/path" options should force the compiler to look in those directories, but it doesnt seem to like it.

To be honest I'd much much rather link dynamically, but like I said above, it requires software FPU support and this doesn't seem to work (or at least I can't make it!)

Very frustrating!
 
A couple of ideas

You don't need the quotes round the path

You're statically linking which requires libjpeg.a, libjpeg.so is the dynamic version
 
Thank you parkydr...

Seems I have every *.a file except for libjpeg.a.

I'm going to try something naughty and see if it works, if not I guess I'll be having fun building some libraries today :)
 
If you mean renaming libjpeg.so to libjpeg.a, no no no you don't ;)

I would personally recommend looking into obtaining the Open2X toolchain... it should produce much faster programs than the GPH SDK. :)
 
Mudi said:
I would personally recommend looking into obtaining the Open2X toolchain... it should produce much faster programs than the GPH SDK. :)
He's already done that (see the first post), but gethostbyname() needs to have the .so available at runtime which is why the GPH toolchain needs to be used instead. To use the open2x toolchain like this also needs the open2x filesystem installing, which isn't ready yet.
 
Last edited by a moderator:
Thanks all,

And yes that is exactly my problem Woogal.

I thought that copying my open2x libc file into my program's dir and setting the LD_LIBRARY_PATH to use that dir first might help but it didn't. Even loading the program through the open2x ld-linux file just results in an instant segfault.


If anybody has any ideas - I'm all ears :)
 
Hmm, well I downloaded the standard Windows toolchain with DevC++ included and built the project with no problems.

However, the code still SIGSEGVs in the same place!

CODE

struct hostent *he;
if ((he=gethostbyname("localhost")) == NULL) { // get the host info
printf("Gethostbyname failed\n");
return;
}



Surely I must have missed something basic here?
 
Parkydr said:
[snip]

You're statically linking which requires libjpeg.a, libjpeg.so is the dynamic version
I have just downloaded and installed the same SDK and bumped into the same problem.
There are static libraries in the directory: .../gp2xsdk/Tools/arm-gp2x-linux/lib/static
but they do not include: libjpeg.a or libpow.a -- both are required to use SDL_image.

Does anyone know a location to find these libraries?

Can anyone provide a shell script that will compile them for this SDK?

Thanks in advance.

[Editted: 8 January 2008

I gave up on the Gamepark SDK and installed gp2xdev. Even this one required
that I comment out the ncurses build before it would complete.

Seems to me the programmer pool is not so large if these problems exist in
year old software. :-(
]
 
Last edited by a moderator:
Back
Top