Results 1 to 6 of 6

Thread: Problems running examples with resources

  1. #1
    Serf
    Join Date
    Sep 2010
    Posts
    2

    Default Problems running examples with resources

    Hi,

    I managed to successfully compile and link almost all the examples but I can run only a few of them.

    For example basic2d links fine but upon running says: "A long jump has been executed" and stops. The error occurs on the line where resource/logo.png is loaded.

    Similar problem is with GUIBasic where it finds the resources ok but bails out on gui.exec() with an emotional if ambiguous error: "GRR!".

    I assume that these errors have something to do with resource folders or similar, but I cannot figure out what...

    For example CustomGL and MultiWindow examples work fine.

    I'm using the precompiled 2.2.2 for Visual Studio 2008 on Visual Studio Express 2008. The OS is Windows 7 64 and graphics card the Mobility Radeon X1700 with the newest modded drivers.

    Please help,

    Seppo

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by spietari View Post
    For example basic2d links fine but upon running says: "A long jump has been executed" and stops. The error occurs on the line where resource/logo.png is loaded.

    Similar problem is with GUIBasic where it finds the resources ok but bails out on gui.exec() with an emotional if ambiguous error: "GRR!".
    I have heard that someone else has the same problem.

    It seems to be a problem with the png loader somewhere.

    On my new installation of Windows7 64bit. I tried the precompiled libs, and it worked. (Compiling 32bit, because I am using Express Edition)

    I tried damaging the png to check error handling: "Exception caught: PNG read failed: Invalid IHDR chunk"

    Where and how do you get the "A long jump has been executed" error?

    The GUIBasic error is a bit naughty of ClanLib. I'm not sure why it does not return the correct exception.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I had a quick look

    I am not sure why we even use the C++ unfriendly setjmp() and longjmp() functions.

    Looking at:
    Code:
    void CL_PNGProvider_Impl::pngread_error_handler(png_structp png_ptr, png_const_charp msg)
    {
    	...
    	longjmp(instance->jmpbuf, 1);
    
    }
    I cannot see a reason why we simply could not throw an exception at this point, and catch it in CL_PNGProvider_Impl::init() to perform cleanup before throwing it again.

    (For reference: http://www.libpng.org/pub/png/book/chapter14.html (search for readpng2_error_handler )

    Maybe someone can look into this. I can't replicate the problem, so I don't know if this is the cause.

  4. #4
    Master Sorcerer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    I guess we could replace the longjmp with a throw statement. I can't see any errors in doing that instead.

    Either way, it got to be the ugliest library design I've seen in a long time to demand you to do a longjmp from a callback.

  5. #5
    Serf
    Join Date
    Sep 2010
    Posts
    2

    Default

    Thanks guys, how could I go about actually making the png library work? What's the cause of this error?

    Seppo

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Compile ClanLib, not using the precompiled libraries should help.

    If that does not help, try compiling libpng (source found at: http://clanlib.org/wiki/ExternalLibraries )

Similar Threads

  1. CL_Integer resources migration to 2.0
    By Shulberry in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 07-28-2010, 06:37 PM
  2. Problems running ClanLib examples
    By trigger-happy in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 02-10-2010, 03:19 PM
  3. Resource Manager's additional resources
    By Ekowc in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 03-15-2009, 12:50 AM
  4. RPG tiles resources?
    By whisperstorm in forum Novashell Game Creation System
    Replies: 2
    Last Post: 02-15-2007, 02:28 AM
  5. Handling zip archives as resources
    By Sherack Nhar in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 11-11-2006, 12:49 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •