* * *

Author Topic: Compiling app in Cocoa Graphics could not be loaded from resource  (Read 1284 times)

josh

  • Sr. Member
  • ****
  • Posts: 437
Hi

Just downloaded lates SVN 54499.

Tried to compile my app for cocoa (both I386 and x86-64), but it generates an error before anything is displayed.

TCocoaWidgetset.RawImage_CreateBitmaps TODO Depth=32 alpharec=8 byteorder=0 alpha=24 red=16 green=8 blue=0
Exception=Graphics could not be loaded from resource.
[FORMS.PP] Exceptionoccurred.

Non of my res files have any graphics in, except the app icon file.

I can compile fine on Carbon, WIn32/Win64

ANy idea?
« Last Edit: March 29, 2017, 12:35:33 pm by josh »
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

Phil

  • Hero Member
  • *****
  • Posts: 2324
Re: Compiling app in Cocoa Graphics could not be loaded from resource
« Reply #1 on: March 29, 2017, 03:49:58 pm »
TCocoaWidgetset.RawImage_CreateBitmaps TODO Depth=32 alpharec=8 byteorder=0 alpha=24 red=16 green=8 blue=0
Exception=Graphics could not be loaded from resource.
[FORMS.PP] Exceptionoccurred.

You're calling code that is known to be incomplete, as indicated by the debug message ("TODO").

File a bug report.

josh

  • Sr. Member
  • ****
  • Posts: 437
Re: Compiling app in Cocoa Graphics could not be loaded from resource
« Reply #2 on: March 29, 2017, 10:46:23 pm »
Hi Phil,

Thanks for responding. I reported this back in OCtober (0030675)  with sample proj, and have only very recently got a working laz svn installed again thanks to DonAlfredo; regarding patching 2 files to allow laz to build via fpcupdeluxe.

I was hoping that possibly a fix may have been implemented, also whether anyone else is getting this problem.
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

josh

  • Sr. Member
  • ****
  • Posts: 437
Re: Compiling app in Cocoa Graphics could not be loaded from resource
« Reply #3 on: August 11, 2017, 11:40:42 am »
Hi
Opening my old post, as still relevant.

I have just downloaded latest svn to retest and try to isolate the cause, as it is still there.

I have a few application, that compile and run fine on Windows and OSX carbon, trying to get them to run Cocoa is causing major problems.

The issue is not consistent, as some applications that use exactly the same components work fine, and other do not. I get the above error which causes when targeting Cocoa.

So far, my test seem to be pointing to Resource files, as I have text, graphics and even zip files in my resource file which is compiled with the app, this works 100% on win and fine on osx carbon, but it appears to be causing a issue with cocoa.
I get no compile warning, errors, messages, error is happening only when app bundle is run in Cocoa.

I will  create a sample project later and attach to here, struggling to reduce the zipped file size down to fit in limitation on upload, as the resource needs text, graphics etc to exhibit the issue.

Hoping someone has come across this, as would be nice to move over to Cocoa.

Josh

Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus