FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IMG_Load doing a segment fault

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
Zardoz



Joined: 28 May 2011
Posts: 17
Location: Spain

PostPosted: Tue May 31, 2011 4:32 pm    Post subject: IMG_Load doing a segment fault Reply with quote

I'm using DMD 2.052 wich svn Derelict2 rev 551 in kUbuntu 10.10 x64

I'm trying to use IMG_Load to load a image file and I get a segment fault wich any path that I put to IMG_Load.

Code :
Code:

import std.stdio;
import std.string;
import derelict.sdl.sdl;
import derelict.sdl.image;

//SDL_GLDisplay d;

int main () {
   
   writeln("Loading...");   
   
   DerelictSDL.load();
    DerelictSDLImage.load();

    if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
        writeln("Error init.");
    }

    SDL_Surface * screen = SDL_SetVideoMode (800,600,32,SDL_HWSURFACE);
    SDL_Surface * image = IMG_Load (toStringz("/home/luis/proyectos/DGame/bin/res/test.png"));
   
   SDL_Delay(1000);// Delay of 1 second
   return 0;
}


What i'm doing wrong ?
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Wed Jun 01, 2011 6:18 am    Post subject: Reply with quote

It doesn't look like you're doing anything wrong. But, I see you're using a 64-bit system. Most of the bugs reported here lately have been on 64-bit Linux. So it might have something to do with that. Do you have access to a 32-bit system to test it on?
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Zardoz



Joined: 28 May 2011
Posts: 17
Location: Spain

PostPosted: Wed Jun 01, 2011 9:12 am    Post subject: Reply with quote

Not, I'm using 64 bits in all of my pc's,m but I just discover how avoid these bug...

I got the same problem using any GLU function like gluBuild2DMipmaps , and searching about problems with Derelict and GLU, I find that --export-dynamic flag can do give some problems. I erased these flag from dmd.conf, and now I can use GLU functions and IMG_Load without any segmentation fault.

This pretty anoying... I'm thinking that some problems that i'm getting are realted to dmd.

I try GDC. I read that GDC support actual D2, but I get confused about it, becuase, when I try to use GDC with a hello word code with writeln, I get a error : undefined identifier writeln, did you mean function writefln? And the -v2 flag is unrecognized. I think that will do a rfresh install to last kubuntu version of 32 bits, to try avoid some of this weird problems...
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Thu Jun 02, 2011 6:48 am    Post subject: Reply with quote

Zardoz wrote:
I got the same problem using any GLU function like gluBuild2DMipmaps , and searching about problems with Derelict and GLU, I find that --export-dynamic flag can do give some problems.


Thanks for letting me know. I didn't event think about that. I know it's caused other problems before.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Zardoz



Joined: 28 May 2011
Posts: 17
Location: Spain

PostPosted: Thu Jun 02, 2011 5:22 pm    Post subject: Reply with quote

More funnier ... I discover that now I can remove pragma(lib, "....\DerelictUtil.a". Before I need it to compile without anoying linking errors.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 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