Coding Academy - Project 4 Question

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Coding Academy - Project 4 Question

Postby chriswadams » Sun Jul 11, 2010 9:44 pm

Well, I'm back again with another strange error message ...

I'm working on Project 4 of the Coding Academy (the 'Fish Feast' game), and I'm having a problem with SDL. It refuses to display the 'background.jpg' file in the window. In fact, every time I run the program, it simply crashes with this message:

Unhandled Exception: SdlDotNet.Core.SdlException: Couldn't open media/background.jpg
at SdlDotNet.Graphics.Surface..ctor (System.String file) [0x00000]
at fishfeast.MainClass.Main (System.String[] args) [0x00014] in /home/chris/Projects/fishfeast/fishfeast/Main.cs:20


I followed Paul's suggestion to copy the files to the "fishfeast/fishfeast/bin/debug" folder, but I still get the error message. I have changed the program's 'Output Path' to "fishfeast/fishfeast" as Paul instructed (and setup a 'media' file there with the 'background.jpg' and 'logo.png' files) to no avail. I have double checked the list of dependencies (on p.32 of the Coding Academy) to be sure I have them all installed, and I have even installed the dependencies listed at the "SDL.NET" site ( http://cs-sdl.sourceforge.net/index.php ... to_SDL.NET ) to make sure I have those available. I still get the error message.

One other thing I have noticed is that when I tried to add the following command:

Code: Select all
sfcMain.Fill(Color.DarkBlue);


I simply got a black window. No other colors would work.

Any advice would be greatly appreciated.
chriswadams
User avatar
chriswadams
 
Posts: 27
Joined: Tue Dec 01, 2009 12:54 am

Postby Ram » Sun Jul 11, 2010 10:02 pm

Are you using the supplied DVD or running Mono from a 64 bit OS ?

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1684
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby chriswadams » Mon Jul 12, 2010 10:24 pm

Ram --

I'm using 32-bit Ubuntu 10.04.

Incidentally, I tried booting from the included DVD in Live mode, and running the edition of Fish Feast from the DVD, and all I got was a blank, black window. Nothing else.

Also, the SDL site has a list of recommended dependencies, and I made sure they were all installed on my computer. They all installed fine except one, called "libsdl1.2debian-all" . That one insisted on uninstalling my ubuntu-desktop package (of all things), so I skipped it. I hope that isn't the one dependency I really, really need!

chriswadams
User avatar
chriswadams
 
Posts: 27
Joined: Tue Dec 01, 2009 12:54 am

Postby Ram » Tue Jul 13, 2010 8:25 am

I don't have libsdl1.2debian-all installed but I do have libsdl1.2debian installed.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1684
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby kdamica » Fri Sep 03, 2010 10:39 pm

I'm having the same problem. Here's the error I get:

Module loaded: Fishfeast, Version=1.0.3898.33352, Culture=neutral, PublicKeyToken=null.
Module loaded: SdlDotNet, Version=6.1.0.0, Culture=neutral, PublicKeyToken=26ad4f7e10c61408.
Module loaded: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Module loaded: Tao.Sdl, Version=1.2.13.0, Culture=neutral, PublicKeyToken=9c7a200e36c0094e.
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 587: saw number, expected matrix
Stacktrace:

at (wrapper managed-to-native) Tao.Sdl.Sdl.SDL_MapRGBA (intptr,byte,byte,byte,byte) <0x00090>
at (wrapper managed-to-native) Tao.Sdl.Sdl.SDL_MapRGBA (intptr,byte,byte,byte,byte) <0xffffffff>
at SdlDotNet.Graphics.Surface.GetColorValue (System.Drawing.Color) <0x0016f>
at SdlDotNet.Graphics.Surface.Fill (System.Drawing.Rectangle,System.Drawing.Color) <0x0011b>
at SdlDotNet.Graphics.Surface.Fill (System.Drawing.Color) <0x001c3>
at Fishfeast.MainClass.Main (string[]) [0x00014] in /home/kenny/Projects/Fishfeast/Fishfeast/Main.cs:17
at (wrapper runtime-invoke) Fishfeast.MainClass.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

/usr/bin/mono() [0x47b77f]
/usr/bin/mono() [0x4aef3f]
/lib/libpthread.so.0(+0xf8f0) [0x7feea8b8b8f0]
/usr/lib/libSDL-1.2.so.0(SDL_MapRGBA+0) [0x7feea6f36320]
[0x40025b30]

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
kdamica
 
Posts: 2
Joined: Fri Sep 03, 2010 10:38 pm

Postby Ram » Fri Sep 03, 2010 11:54 pm

Need to see your code

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1684
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby kdamica » Sat Sep 04, 2010 4:53 am

Code is the same as in the lesson. Works if I comment out the fill color line.

Code: Select all
using SdlDotNet.Core;
using SdlDotNet.Graphics;
using SdlDotNet.Input;
using System;
using System.Collections.Generic;
using System.Drawing;


namespace Fishfeast
{
   class MainClass
   {
      static Surface sfcMain;
      public static void Main (string[] args)
      {
         sfcMain = Video.SetVideoMode(1024,768);
         sfcMain.Fill(Color.DarkBlue);
         Events.Quit += new EventHandler<QuitEventArgs>(Events_Quit);
         Events.Run();
      }
      static void Events_Quit(object sender, QuitEventArgs e){
         Events.QuitApplication();   
      }
   }
}
kdamica
 
Posts: 2
Joined: Fri Sep 03, 2010 10:38 pm

Postby amos » Mon Nov 29, 2010 3:05 pm

I'm having exactly the same problem on Debian amd64. Has anyone come up with a solution or a work around?
May the wind at your back never be your own!
amos
 
Posts: 5
Joined: Sun Jul 17, 2005 1:44 pm

Postby Ram » Tue Nov 30, 2010 1:11 am

amos wrote:I'm having exactly the same problem on Debian amd64. Has anyone come up with a solution or a work around?


As far as I know there's a bug in SDL when running 64 bit OS which causes a blank/black screen. No idea if it's been resolved or not.

All the SDL stuff from the academy I did, I ended up doing on 32 bit Ubuntu.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1684
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

SDL Not working on x86_64 :-(

Postby euphogeeza » Thu Dec 23, 2010 2:14 pm

I thought I must be doing something wrong. I checked, double checked, deleted and re-wrote code. Aaghh! :cry:

I'm running OpenSUSE 11.2 Emerald 2.6.31.14-0.4-desktop SMP PREEMPT x86_64.

Does anyone know if there is a fix for 64 bit O/S?
euphogeeza
 
Posts: 2
Joined: Fri Nov 16, 2007 5:37 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests