forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gsLib and libjpg

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
sincro



Joined: 27 Jan 2004
Posts: 25

PostPosted: Tue Jun 28, 2005 1:11 am    Post subject: gsLib and libjpg Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Jun 28, 2005 1:14 am    Post subject: Reply with quote

Are you sure it isn't 'libjpeg.a' instead of 'libjpg.a'?

If so, you'd need a '-ljpeg'.
Back to top
View user's profile Send private message Visit poster's website
sincro



Joined: 27 Jan 2004
Posts: 25

PostPosted: Tue Jun 28, 2005 1:17 am    Post subject: Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Jun 28, 2005 1:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sincro



Joined: 27 Jan 2004
Posts: 25

PostPosted: Tue Jun 28, 2005 1:56 am    Post subject: ** PROBLEM SOLVED ** Reply with quote

Ok, now all work

Thanks to ooPo and emoonwork for help

you can download source code of test HERE
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group