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 

Makefile error including SDL - [NOT RESOLVED]

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



Joined: 14 Oct 2005
Posts: 154

PostPosted: Wed Aug 09, 2006 1:28 am    Post subject: Makefile error including SDL - [NOT RESOLVED] Reply with quote

Im using SDL as a backbone for both sounds and textures, and Im getting undefined references to jpeg and png calls from cygwin when compiling. So i go and set it up by including:
Code:

-lSDL_image -lSDL_mixer -lpng -lz -ljpeg

Im still getting hte exact same error after adding those... Any idea how to get rid of these undefined errors?

(Oh and i have the png and jpeg header included in the source...)

If you need to see the whole makefile, just tell me and ill post it.
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Wed Aug 09, 2006 2:29 am    Post subject: Reply with quote

Are you using C++? Alot of libs headers need extern "C" {} added around the code to work in C++.

If not, post the exact error and the makefile.

Also bear in mind order is important. Countless times I've had to add libs twice just to get the order right.
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Wed Aug 09, 2006 3:16 am    Post subject: Reply with quote

Kojima wrote:

Also bear in mind order is important. Countless times I've had to add libs twice just to get the order right.

That's most likely it. Permutate through the order of your links until it works.
_________________
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Back to top
View user's profile Send private message Visit poster's website
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Wed Aug 09, 2006 7:04 am    Post subject: Reply with quote

this order work fine for me

-lpng -lz -ljpeg -lm \
-lSDL_image -lSDL_mixer \
-lfreetype -lstdc++ -lsupc++ \
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Wed Aug 09, 2006 8:19 pm    Post subject: Reply with quote

Just tried yours and nothing :(

All im getting is inside SDL_image's IMG_Load function, there are undefined references to jpeg and png calls/functions...
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Wed Aug 09, 2006 8:24 pm    Post subject: Reply with quote

Did you try the Extern "C" thing? That usually solves unresolved links when using C++ (you havn't stated which you use)
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Thu Aug 10, 2006 4:51 pm    Post subject: Reply with quote

is your libraries of images installed
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Thu Aug 10, 2006 8:32 pm    Post subject: Reply with quote

The only thing i havent tried is the extern C thing, but where should i put it? Around the including of SDL?
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Thu Aug 10, 2006 10:10 pm    Post subject: Reply with quote

if you are coding in c++ then say you have main.cpp and
wanted to use a texure.c file made from bin2c
Code:

extern "C" {
//c stuff goes here
//ex. if you bin2c a image and your output is a tex_mario.c file
//the object is made into a .c file but you want to use in C++
//to use the image and store array into a buffer and so forth
//you would need to make file known to sources by
//making that file extern to all sources ....and to do
//this you need to add its use in these braces
extern unsigned int size_tex_mario;
extern unsigned char tex_mario[];
};


and thats one of the ways you can use extern "C"
the undefined errors have nothing to with extern "C" {
the undefined errors have nothing to do with if you include
in C or C++

this is a preproccessor problem ...so check your include
ordering ...tip: sdl_image.h uses png so include png.h earlier
so sdl_image.h can use ....if its not your preproccessor order
then either your linking yet again is wrong or the compiler is
not finding the libraries ....so double check by reconfiguring,
remaking, and then remake installing all the libs needed

if you do all this and yet you have the same problem then come back :P
_________________
10011011 00101010 11010111 10001001 10111010
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 -> PSP 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