Re: Derelict / SDL error

2014-12-11 Thread Paul via Digitalmars-d-learn
On Thursday, 11 December 2014 at 00:36:08 UTC, Mike Parker wrote: More evidence pointing toward the system configuration on the problem machines. I'm quite far from being a Linux guru, but at this point I would be looking at removing the binaries I've compiled myself and installing the binary p

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/11/2014 4:17 AM, Paul wrote: On Wednesday, 10 December 2014 at 18:58:15 UTC, Paul wrote: The two machines on which errors occur are a Mint 13 (32 bit) box and an ageing laptop with Lubuntu 14.04. I've followed the same procedures but the 64 bit obviously has the 64 bit dmd compiler. Jus

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:58:15 UTC, Paul wrote: The two machines on which errors occur are a Mint 13 (32 bit) box and an ageing laptop with Lubuntu 14.04. I've followed the same procedures but the 64 bit obviously has the 64 bit dmd compiler. Just added SDL_image to this 64 bit s

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:06:08 UTC, Paul wrote: On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned.

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned. Maybe not. The trouble is that others have been able to com

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned. Maybe not. The trouble is that others have been able to compile and run the same code without error. Given that you are still un

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:10:23 UTC, Mike Parker wrote: Also, though this is unrelated (I just noticed it when looking at your code again), I strongly recommend you move the line scope( exit ) SDL_Quit(); to somewhere after DerelictSDL2.load(). If the SDL shared library fails to

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 09:07:56 UTC, ketmar via Digitalmars-d-learn wrote: do you have the corresponding libraries installed? SDL_Image uses libpng and libjpeg for decoding images, so if you don't have those installed (with corresponding -dev if your system needs that) you will not

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/10/2014 5:59 PM, Paul wrote: Adding that reveals that I need to add SDL_image 2.0 (I didn't know that that wasn't a part of the standard SDL install) so I've compiled that too. I now get the error: Unsupported image format whether I use a png or jpg. int flags = IMG_INIT_PNG | IMG_INIT

Re: Derelict / SDL error

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 08:59:36 + Paul via Digitalmars-d-learn wrote: > Adding that reveals that I need to add SDL_image 2.0 (I didn't > know that that wasn't a part of the standard SDL install) so I've > compiled that too. I now get the error: > > Unsupported image format > > whether I use

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 22:27:43 UTC, anonymous wrote: On Tuesday, 9 December 2014 at 16:12:35 UTC, Paul wrote: import derelict.sdl2.sdl; import std.stdio; import std.conv; void main() { scope(exit) { SDL_Quit(); } DerelictSDL2.load(); DerelictSDL2Im

Re: Derelict / SDL error

2014-12-09 Thread anonymous via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 16:12:35 UTC, Paul wrote: import derelict.sdl2.sdl; import std.stdio; import std.conv; void main() { scope(exit) { SDL_Quit(); } DerelictSDL2.load(); DerelictSDL2Image.load(); When I run dub that last line gives me: sourc

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:53:11 UTC, Paul wrote: Whoa, I read that wrong - I'm sure I tried just adding DerelictSDL2Image.load() to my program an it didnt work. Trying again. The top of my app.d looks like this: import derelict.sdl2.sdl; import std.stdio; import std.conv; void main()

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:48:32 UTC, Paul wrote: On Tuesday, 9 December 2014 at 15:40:00 UTC, Mike Parker wrote: On 12/10/2014 12:19 AM, Paul wrote: dub doesn't know anything about DerelictSDL2Image (and even if it did, just importing it isn't going to tell dub about it -- you would ne

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:40:00 UTC, Mike Parker wrote: On 12/10/2014 12:19 AM, Paul wrote: dub doesn't know anything about DerelictSDL2Image (and even if it did, just importing it isn't going to tell dub about it -- you would need to add it to your dub.json as a dependency). That's be

Re: Derelict / SDL error

2014-12-09 Thread Mike Parker via Digitalmars-d-learn
On 12/10/2014 12:19 AM, Paul wrote: I don't fancy introduing another layer of complexity in a debugger at present! I wonder if it's the .bmp that's causing the problem. I can't quite figure how to get Derelict SDL_Image into my project at present (dub doesn't fetch it if I add import derelict.s

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 13:34:56 UTC, Jack wrote: Can't really think of anything that can solve your problem. Only time I had a seg fault is calling a method from an uninitialized class. You can try to get a debugger and/or a gui that comes with it(personally I use gdb with ddd) to find

Re: Derelict / SDL error

2014-12-09 Thread Jack via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 10:19:38 UTC, Paul wrote: On Monday, 8 December 2014 at 21:01:40 UTC, Paul wrote: On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whateve

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 21:01:40 UTC, Paul wrote: On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been an

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been an outdated piece of software that's been making the fuss.

Re: Derelict / SDL error

2014-12-08 Thread Jack via Digitalmars-d-learn
On Monday, 8 December 2014 at 12:53:11 UTC, Paul wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from a

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:35:17 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: > import std.conv : to; > writeln( "Error: ", to!string( SDL_GetError() ));

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn wrote: > On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: > > > import std.conv : to; > > writeln( "Error: ", to!string( SDL_GetError() )); > > Cleaner! ah, sure. i just wanted to use libc's fprintf() to avoid importi

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( "Error: ", to!string( SDL_GetError() )); Cleaner! Any ideas where to look for the source of the problem?

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:47:47 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn wrote: besides, i don't think that you'll get something sane from `SDL_GetError()` in the case of segfault. Your're right, no help at all. I sh

Re: Derelict / SDL error

2014-12-08 Thread Mike Parker via Digitalmars-d-learn
On 12/8/2014 10:37 PM, Paul wrote: I added this around the problem line to catch the problem: try{ SDL_RenderCopy(renderer, texture, &sourceRect, &destRect); } catch{} finally { writeln( "Error: " , SDL_GetError() ); } The program now works from a termina

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn wrote: > The program now works from a terminal as expected (!) BUT when > SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or > just some address/value as it is different each time). FYI: SDL_GetError() returns 'char*

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:23:12 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: > On Mon, 08 Dec 2014 12:53:10 + > Paul via Digitalm

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn wrote: > On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via > Digitalmars-d-learn wrote: > > On Mon, 08 Dec 2014 12:53:10 + > > Paul via Digitalmars-d-learn > > wrote: > > > >> Sorry this is a bit off topic but as there do

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn wrote: > Sorry this is a bit off topic but as there doesn't seem to be an > active forum for Derelict atm > > This simple test code is giving me an error 'Error executing > command run: Program exited with code -11' (or a seg

Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from a terminal). The problem line is: SDL_RenderCopy(rendere