| View previous topic :: View next topic |
| Author |
Message |
sincro
Joined: 27 Jan 2004 Posts: 25
|
Posted: Tue Jun 28, 2005 1:11 am Post subject: gsLib and libjpg |
|
|
Hi to all, i need help :)
i'm working on tool in gslib and i need to use libjpg but i have problem with make file:
| Code: | EE_BIN = jpg.elf
EE_OBJS = jpg.o
EE_LIBS += -lgcc -lgs -ljpg -lc -lkernel -lc -lsyscall -ldebug -lsyscall -lkernel
EE_INCS += -I$ ./INC
EE_LDFLAGS += -L$ ./LIB
all: $(EE_BIN)
clean:
del *.elf *.o *.a
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
|
in subdir LIB i have put libgslib.a and libjpg.a
in subdir INC i have put all needed file include by two lib
when i compile:
| Code: | ee-g++ -D_EE -O2 -G0 -Wall -IC:\PS2Dev\COMPILER\LIB\PS2SDK/ee/include -IC:\PS2D
ev\COMPILER\LIB\PS2SDK/common/include -I. -I./INC -c jpg.cpp -o jpg.o
ee-gcc -mno-crt0 -TC:\PS2Dev\COMPILER\LIB\PS2SDK/ee/startup/linkfile -LC:\PS2Dev
\COMPILER\LIB\PS2SDK/ee/lib -L./LIB \
-o jpg.elf C:\PS2Dev\COMPILER\LIB\PS2SDK/ee/startup/crt0.o jpg.o
-lgcc -lgs -ljpg -lc -lkernel -lc -lsyscall -ldebug -lsyscall -lkernel -lc -lke
rnel
jpg.o: In function `displayjpeg(jpgData*)':
jpg.o(.text+0x84): undefined reference to `jpgReadImage(jpgData*, unsigned char*
)'
jpg.o(.text+0x94): undefined reference to `jpgClose(jpgData*)'
jpg.o: In function `main':
jpg.o(.text+0x218): undefined reference to `jpgOpen(char*)'
jpg.o(.data+0x15): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [jpg.elf] Error 1
|
how to solve this problem?
the main jpg.cpp have include libjpg.h
help please
sincro |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jun 28, 2005 1:14 am Post subject: |
|
|
Are you sure it isn't 'libjpeg.a' instead of 'libjpg.a'?
If so, you'd need a '-ljpeg'. |
|
| Back to top |
|
 |
sincro
Joined: 27 Jan 2004 Posts: 25
|
Posted: Tue Jun 28, 2005 1:17 am Post subject: |
|
|
yes i'm sure
is libjpg Ported by linuzappz on cvs root, not libjpeg from ps2sdk-ports
if you want i post link with my test sourcecode
EDIT: you can download my test source code here |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jun 28, 2005 1:30 am Post subject: |
|
|
| Quote: | <emoonwork> you need -lstdc++ to get rid of __gxx stuff atleast
<sincro> i try emoonwork
<emoonwork> ooPo: maybe no extern "C" {...} in the header for the C functions?
<ooPo> hmm, that's quite possible
<sincro> <emoonwork> with -lstdc++ i solve __gxx stuff problem
<ooPo> yup, no extern in the header
<sincro> but other undefined reference have problem
<sincro> i have past source code link on forum
<ooPo> http://cvs.ps2dev.org/libjpg/libjpg/include/libjpg.h?rev=1.3
<emoonwork> ok, no extern "C"
<ooPo> just put some around where it is included in his code
<emoonwork> yeah
<sincro> ?
<sincro> extern c in source?
<sincro> ok i try |
| Code: | #ifdef __cplusplus
extern "C" {
#endif
#include <libjpg.h>
#ifdef __cplusplus
}
#endif |
| Quote: | <sincro> YEAH compiler work
<sincro> tnx tnx tnx
<sincro> :) |
|
|
| Back to top |
|
 |
sincro
Joined: 27 Jan 2004 Posts: 25
|
Posted: Tue Jun 28, 2005 1:56 am Post subject: ** PROBLEM SOLVED ** |
|
|
Ok, now all work
Thanks to ooPo and emoonwork for help
you can download source code of test HERE |
|
| Back to top |
|
 |
|