Recent

Author Topic: Can't launch Lazarus with one particular package on OSX only  (Read 7165 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Can't launch Lazarus with one particular package on OSX only
« on: February 11, 2014, 09:58:24 pm »
Hi,

I have installed Lazarus 1.0.14 on Lazarus and it works not too bad, I can compile and execute some simple applications in the EDI.

I have also made my own package (Gestinux_util) which works fine for me on several Windows and Linux Lazarus installations.

If I try to install this specific package  on Lazarus for OSX (I have only 10.6), it compiles, no error is visible when installing, but Lazarus do not launch afterwards.

After this package installation attempt, I can only launch Lazarus by executing in a terminal : /Developer/lazarus/lazarus
I see some debug messages in the terminal, but nothing looks related to the new package (I can post it if it helps, but I doubt).
This way Lazarus is running, but I have no menu and can't do much...

My only choice is to delete the new lazarus executable and restore lazarus.old ...

There is obviously someting wrong with my package, but how can I find what ?
Your ideas are welcome !

Thanks
Tintinux
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12188
  • Debugger - SynEdit - and more
    • wiki
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #1 on: February 11, 2014, 10:13:17 pm »
I am not on Mac, so I cant comment on the issue itself.

But when running from terminal, try:

/Developer/lazarus/lazarus.app/Contents/MacOS/lazarus


Also, this may be a sym-link. Check where it points too

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #2 on: February 19, 2014, 09:04:41 am »
Hi

The path you suggest is exactly the same as in the app, i.e the normal way to run the IDE.
So, the result is the same, Lazarus crashes without message.

I suppose there is something wrong in one of my component instanciation (Create or so).
If I'm not wrong, DebugLn can't be used the debug this ?
My question was : Is there any other way to debug, except removing components creation or code lines  until it works ?

Thanks.
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #3 on: July 13, 2016, 06:04:05 pm »
Hi

It took time, but  I have found the cause of the issue :

In one unit of a package I created there is in the initialization section :

Code: Pascal  [Select][+][-]
  1. var i : byte; [...]  for i := 1 to DefaultFormatSettings.CurrencyDecimals do ....

This raise no error on Windows and Linux, but on OS X, after the package is successfully compiled and then installed, Lazarus can't launch anymore, without visible message.

I changed to :
Code: Pascal  [Select][+][-]
  1. var i : byte; [...]  for i := 1 to 2 do ....

and the package can be installed, and Lazarus can be launched afterwards.

Has anyone heard of a similar bug, or anything to say, before I file it in the bucktracker ?

PS : now, I'm with Lazarus 1.6

Regards



« Last Edit: July 13, 2016, 06:36:25 pm by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #4 on: July 13, 2016, 06:19:25 pm »

Code: Pascal  [Select][+][-]
  1. var i : byte; [...]  for i := 1 to DefaultFormatSettings do ....


That code doesn't tell me anything. Normally DefaultFormatSettings is a record.

http://www.freepascal.org/docs-html/rtl/sysutils/defaultformatsettings.html

-Phil

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #5 on: July 13, 2016, 06:38:19 pm »
Yes you are right !  :o
It was DefaultFormatSettings.CurrencyDecimals
I corrected in the post.
Best regards
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #6 on: July 13, 2016, 06:50:19 pm »
It was DefaultFormatSettings.CurrencyDecimals

Why are you using that in a loop? CurrencyDecimals is just the number of decimal digits that currency values should be reported to for your locale. On my system, it has a value of 2.


tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #7 on: July 13, 2016, 07:28:29 pm »
This is to make a format string, depending on the actual value.
Yes, it is also equal to 2 in most countries...
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Can't launch Lazarus with one particular package on OSX only
« Reply #8 on: July 13, 2016, 07:42:19 pm »
You've got something else going on then. Looping through the value of CurrencyDecimals works fine on OS X too.

In any case, why aren't you just using FloatToStrF or equivalent?

-Phil

 

TinyPortal © 2005-2018