Recent

Author Topic: [SOLVED] Mac OS X SOLUTION...  (Read 21516 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
[SOLVED] Mac OS X SOLUTION...
« on: February 03, 2011, 11:35:45 pm »
Hello everybody.
I have some trouble with Lazarus for OS X.
The installation worked perfectly and i can compile and run programs done on the mac.

The goal was to compile to OS X a Free DJ audio program writed in Lazarus for Linux. (see my web site)
That program is also compiled on Windows and is running.

In lazarus for OS X, it compile without problems
(only warnings  unknow stabs type in 0xE0)
 but when i run it with debugger i get "External: EXC_BAD_ACCESS and it crash. It opens LCLType.pas on function: HiWord).

When i run the executable via terminal without debugger, it loads, even the audio library is working but all the buttons do not answer, as well for button of dialog messages, also nothing for scrollbars...

If i run the prog.app created by bundle it crash with same error given by debugger.

Strange because a onclick on a label for example respond well.

Any idea ?

Thanks

PS: I use Mac OS X Leopard 5.6.2 and have try with snapshot version of Lazarus for OS X and also official version of Lazarus for OS X (both with no luck).
« Last Edit: February 10, 2011, 10:47:03 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12259
  • FPC developer.
Re: Mac OS X problems...
« Reply #1 on: February 04, 2011, 11:05:09 am »
You need an application bundle iirc.

I'm not Mac export, but have a look here:

http://wiki.freepascal.org/Application_Bundle

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #2 on: February 04, 2011, 08:07:09 pm »
Thank you Marcos for your answer.
Im also not a expert in OS X.
There are my first steps.
My problem : If i import .pas prog done by Lazarus for Windows or Linux into Lazarus for OS X, the compilation works, a prog is created but if i load it i get the error i  have explained in first topic.

If i create a prog directly with Lazarus OS X, it works without problems.
I was thinking, write ones, compile everywhere...but it worked for me only with Linux and Windows, not for OS X... %)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #3 on: February 04, 2011, 09:56:38 pm »
Could you post a backtrace so we can see the sequence of calls leading up to the access violation?

Thanks.

-Phil

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #4 on: February 05, 2011, 11:20:58 pm »
@ PhiL.
With pleasure, the only thing,...
I dont know how to create a backtrace (do you mean the messages from debugger ?).  %)

Thanks
« Last Edit: February 06, 2011, 08:39:40 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #5 on: February 06, 2011, 01:24:42 am »
Open a Terminal window.

gdb myprog.app
break fpc_raiseexception
run

When exception occurs, control will return to the debugger:

bt

Copy the sequence of calls displayed and paste here.

quit  (to exit debugger)

You can enter help at the debugger command line to see all the options.

Thanks.

-Phil

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #6 on: February 06, 2011, 06:56:31 pm »
Yep Phil, thanks.

Here the report :

Code: [Select]
freds-ao533:firstprog fred$ gdb miximum.app
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries ............ done

(gdb) break fpc_raiseexception
Breakpoint 1 at 0xf66e5: file lcltype.pp, line 2901.
(gdb) run
Starting program: /Users/fred/Documents/firstprog/miximum.app/Contents/MacOS/miximum

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? () at lcltype.pp:2901
2901 lcltype.pp: No such file or directory.
in lcltype.pp
(gdb)

Many thanks  :)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #7 on: February 06, 2011, 07:02:11 pm »
That doesn't tell us anything since it's not the complete backtrace (how it got to the point where exception was raised at HiWord).

It looks like you did not enter "bt" to display the backtrace.

Thanks.

-Phil

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #8 on: February 06, 2011, 08:21:35 pm »
Oooops, sorry  :o

Quote
freds-ao533:firstprog fred$ gdb miximum.app
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries ............ done
...
(gdb) break fpc_raiseexception
Breakpoint 1 at 0xf66e5: file lcltype.pp, line 2901.
...
(gdb) run
Starting program: /Users/fred/Documents/firstprog/miximum.app/Contents/MacOS/miximum

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? () at lcltype.pp:2901
2901   lcltype.pp: No such file or directory.
   in lcltype.pp
...
(gdb) bt
#0  0x00000000 in ?? () at lcltype.pp:2901
#1  0x0003f9d6 in MAINMIXXL_TMIXIMUMLP_$__FORMCREATE$TOBJECT () at lcltype.pp:2901
#2  0x00027075 in TCUSTOMFORM__DOCREATE (this=0x6a7f5c0) at ./include/customform.inc:877
#3  0x00025677 in TCUSTOMFORM__AFTERCONSTRUCTION (this=0x6a7f5c0) at ./include/customform.inc:79
#4  0x0002b70b in TFORM__CREATE (THEOWNER=0x6aea020, vmt=0x1, this=0x6a7f5c0) at ./include/customform.inc:2838
#5  0x00031833 in TAPPLICATION__CREATEFORM (INSTANCECLASS=<incomplete type>, REFERENCE=void, this=0x6aea020) at ./include/application.inc:2087
#6  0x00011848 in PASCALMAIN () at lcltype.pp:2901
#7  0x00022545 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () at lcltype.pp:2901
#8  0x0001178b in start () at lcltype.pp:2901
Current language:  auto; currently pascal
...

Many, many thanks  :P
« Last Edit: February 06, 2011, 08:30:30 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #9 on: February 06, 2011, 08:40:53 pm »
Looks like the problem is originating in your form's FormCreate method.

Thanks.

-Phil

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #10 on: February 06, 2011, 09:07:45 pm »
OK Phil, and what do you suggest ?
I use the same resource for Linux and Windows without problems ...

I have seen also that, while loading the project in Lazarus for OS X, not all the objects in the form are visible.

All the images are not show.

Thanks
« Last Edit: February 06, 2011, 09:15:20 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #11 on: February 06, 2011, 09:11:59 pm »
I don't have any suggestions since I don't know what you're doing.

Not sure what you're referring to with "resource".

Thanks.

-Phil

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #12 on: February 06, 2011, 09:18:56 pm »
Hello Phil.
I want to compile a freeware developed with Lazarus on Linux and Windows into a OS X executable.

You can see the 2 versions working on Linux and Windows here :

http://sites.google.com/site/fiensprototyping/

Thanks
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3619
    • StrumPract is the musicians best friend
Re: Mac OS X problems...
« Reply #13 on: February 06, 2011, 09:45:47 pm »
Hi Phil

Cfr ressource, i mean i  use same code and same rc for Linux and Windows and i want to use it also for Mac OS X...
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac OS X problems...
« Reply #14 on: February 06, 2011, 10:11:23 pm »
All I know is that something blows up in your code. You'll need to look at your code and try to isolate where it's occurring. If you can do that, then create a very small example that allows others to reproduce the problem, then post it here and/or in Mantis as part of a bug report.

That it runs on Windows and Linux doesn't really tell me much.

Thanks.

-Phil

 

TinyPortal © 2005-2018