Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coding Academy - Project 4 Question

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
chriswadams



Joined: Tue Dec 01, 2009 12:54 am
Posts: 26

PostPosted: Sun Jul 11, 2010 10:44 pm    Post subject: Coding Academy - Project 4 Question Reply with quote

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:

Quote:
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/The_absolute_newbies_guide_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:
sfcMain.Fill(Color.DarkBlue);


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

Any advice would be greatly appreciated.
chriswadams
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1658
Location: Guisborough

PostPosted: Sun Jul 11, 2010 11:02 pm    Post subject: Reply with quote

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.....
Back to top
View user's profile Send private message MSN Messenger
chriswadams



Joined: Tue Dec 01, 2009 12:54 am
Posts: 26

PostPosted: Mon Jul 12, 2010 11:24 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1658
Location: Guisborough

PostPosted: Tue Jul 13, 2010 9:25 am    Post subject: Reply with quote

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.....
Back to top
View user's profile Send private message MSN Messenger
kdamica



Joined: Fri Sep 03, 2010 11:38 pm
Posts: 2

PostPosted: Fri Sep 03, 2010 11:39 pm    Post subject: Reply with quote

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.
=================================================================
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1658
Location: Guisborough

PostPosted: Sat Sep 04, 2010 12:54 am    Post subject: Reply with quote

Need to see your code
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
kdamica



Joined: Fri Sep 03, 2010 11:38 pm
Posts: 2

PostPosted: Sat Sep 04, 2010 5:53 am    Post subject: Reply with quote

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

Code:
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();   
      }
   }
}
Back to top
View user's profile Send private message
amos



Joined: Sun Jul 17, 2005 2:44 pm
Posts: 5

PostPosted: Mon Nov 29, 2010 3:05 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1658
Location: Guisborough

PostPosted: Tue Nov 30, 2010 1:11 am    Post subject: Reply with quote

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.....
Back to top
View user's profile Send private message MSN Messenger
euphogeeza



Joined: Fri Nov 16, 2007 5:37 pm
Posts: 2

PostPosted: Thu Dec 23, 2010 2:14 pm    Post subject: SDL Not working on x86_64 :-( Reply with quote

I thought I must be doing something wrong. I checked, double checked, deleted and re-wrote code. Aaghh! Crying or Very sad

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?
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast