View previous topic :: View next topic |
Author |
Message |
Zardoz
Joined: 28 May 2011 Posts: 17 Location: Spain
|
Posted: Tue May 31, 2011 4:32 pm Post subject: IMG_Load doing a segment fault |
|
|
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 |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Jun 01, 2011 6:18 am Post subject: |
|
|
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 |
|
|
Zardoz
Joined: 28 May 2011 Posts: 17 Location: Spain
|
Posted: Wed Jun 01, 2011 9:12 am Post subject: |
|
|
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 |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Thu Jun 02, 2011 6:48 am Post subject: |
|
|
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 |
|
|
Zardoz
Joined: 28 May 2011 Posts: 17 Location: Spain
|
Posted: Thu Jun 02, 2011 5:22 pm Post subject: |
|
|
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 |
|
|
|