GP2X Open2x Not Finding Default Libraries (-lz)


Hitnrun

Member
Joined
Mar 1, 2008
Messages
427
Hello!

I don't know what is happening, when compiling the open2x compiler isn't finding the default libraries, like "-lz" for zlib, nor default includes like "png.h", I am needing to pass LDFLAGS="-L/opt/open2x//gcc-4.1.1-glibc-2.3.6/lib" and CFLAGS="-L/opt/open2x/gcc-4.1.1-glibc-2.3.6/include".

Can I fix this?
 

juanvvc

Member
Joined
Jul 19, 2007
Messages
291
Location
Catalonia
Sure, you need "-I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include" in CFLAGS. Just change the -L for -I.

Of course, this only works if you have zlib and libpng installed on open2x. Did you download the libpack from the open2x site? It is a package appart from the toolchain.
 

Hitnrun

Member
Joined
Mar 1, 2008
Messages
427
juanvvc said:
Sure, you need "-I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include" in CFLAGS. Just change the -L for -I.

Of course, this only works if you have zlib and libpng installed on open2x. Did you download the libpack from the open2x site? It is a package appart from the toolchain.
Ops I typed wrong, CFLAGS is with -I.

What I was talking about was, previously I didn't needed to include these CFLAGS and LDFLAGS to programs using libs in the /opt/open2x//gcc-4.1.1-glibc-2.3.6/lib path.

I downloaded the open2x compiler pack from the site, but as for the libs, I compiled it off svn, does this make a difference?
 
Last edited by a moderator:

Orkie

Super Duper Mega GP Mania
Joined
Mar 22, 2006
Messages
2,368
Location
UK
Website
www.gp2x.dev
The libs in SVN should be fine if you got them from the 'libs' directory, but the 'libs-new' ones seem to be a bit unreliable currently. Still, if you want to be certain, download the latest stable lib pack.
 

Hitnrun

Member
Joined
Mar 1, 2008
Messages
427
Orkie said:
The libs in SVN should be fine if you got them from the 'libs' directory, but the 'libs-new' ones seem to be a bit unreliable currently. Still, if you want to be certain, download the latest stable lib pack.
Yes I'm using the libs one, not libs-new.
Doesn't the compiler have a list of "default" directories that it always search? Is there a command line to see this, or even better, change it?

Strange thing is that I never messed with compilling the compiler, only the libs, don't know what went wrong, it worked before...
 
Last edited by a moderator:
Top