Recent

Author Topic: _HiShapeCreateEmpty not found  (Read 13603 times)

Eugene Kryukov

  • New Member
  • *
  • Posts: 15
_HiShapeCreateEmpty not found
« on: October 31, 2009, 07:06:50 am »
Hello,

I'm use lazarus on Mac OS X about one year. I use latest snapshots. But since august 2009 compiled executable stay incompatible with Mac OS X 10.4. Crashed with "_HiShapeCreateEmpty not found". I compile on 10.5 and always use -k-macosx_version_min -k10.4 -XR\Developer\SDKs\MacOSX10.4u.sdk\.

Any one have this trouble ?

Eugene

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
    • havefunsoft.com
Re: _HiShapeCreateEmpty not found
« Reply #1 on: October 31, 2009, 10:11:24 am »
[quote author=Eugene Kryukov
But since august 2009 compiled executable stay incompatible with Mac OS X 10.4. Crashed with "_HiShapeCreateEmpty not found". I compile on 10.5 and always use -k-macosx_version_min -k10.4 -XR\Developer\SDKs\MacOSX10.4u.sdk\.
[/quote]
According to this page:
http://developer.apple.com/legacy/mac/library/documentation/Carbon/Reference/HIShape_Reference/Reference/reference.html#//apple_ref/c/func/HIShapeCreateEmpty

HIShapeCreateEmpty function is available in 10.4.
But since function is case sensetive, should it be" _HIShapeCreateEmpty" instead of "_HiShapeCreateEmpty"?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #2 on: October 31, 2009, 02:55:14 pm »
I'm use lazarus on Mac OS X about one year. I use latest snapshots. But since august 2009 compiled executable stay incompatible with Mac OS X 10.4. Crashed with "_HiShapeCreateEmpty not found". I compile on 10.5 and always use -k-macosx_version_min -k10.4 -XR\Developer\SDKs\MacOSX10.4u.sdk\.

Can you try adding the option -k-no_implicit_dylibs and see whether it helps? See http://lists.apple.com/archives/Carbon-dev/2009/Sep/msg00101.html and the follow-ups for the background information (HIShapeCreateEmpty also moved from one framework to another between 10.4 and 10.5, in this case from Carbon/HIToolBox to ApplicationServices/HIServices)

Eugene Kryukov

  • New Member
  • *
  • Posts: 15
Re: _HiShapeCreateEmpty not found
« Reply #3 on: November 10, 2009, 07:19:15 pm »
I was try -k-no_implicit_dylibs on Leopard but get linker error. We'll try on Snow Leopard ASAP. But way i was can compile my projects without troubles before August'09 (freepascal and lazarus updated in august) ? 

Eugene

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #4 on: November 10, 2009, 10:31:42 pm »
I was try -k-no_implicit_dylibs on Leopard but get linker error. We'll try on Snow Leopard ASAP.
Which linker error? Try compiling with -Cn and then executing the generated ppas.sh to see the full linker output. At least the 10.5 linker supports that option.

Quote
But way i was can compile my projects without troubles before August'09 (freepascal and lazarus updated in august) ? 
Nothing has been changed in FPC back then regarding this. Maybe Lazarus didn't use that routine before (or maybe you didn't use the Lazarus functionality that requires this routine).

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: _HiShapeCreateEmpty not found
« Reply #5 on: November 10, 2009, 11:04:30 pm »
Could you post the results of otool -L on the compiled executable so we can see what libraries it's linked against? It seems like there's already a problem with Lazarus 0.9.28 for Intel Mac requiring 10.5 because of the way it's linked against iconv:

http://www.lazarus.freepascal.org/index.php/topic,7667.msg36658.html#msg36658

Thanks.

-Phil

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #6 on: November 11, 2009, 12:52:53 pm »
Could you post the results of otool -L on the compiled executable so we can see what libraries it's linked against? It seems like there's already a problem with Lazarus 0.9.28 for Intel Mac requiring 10.5 because of the way it's linked against iconv:

http://www.lazarus.freepascal.org/index.php/topic,7667.msg36658.html#msg36658

That problem would be due to a missing -XR/Developer/SDKs/MacOSX10.4u.sdk:

$ cat tt.pp
uses
  cwstring;
begin
end.

$ fpc tt -k-macosx_version_min -k10.5 -XR/Developer/SDKs/MacOSX10.5.sdk
Free Pascal Compiler version 2.4.0rc1 [2009/10/24] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tt.pp
Assembling program
Linking tt
4 lines compiled, 0.1 sec

$ otool -L tt
tt:
   /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)

$ fpc tt -k-macosx_version_min -k10.4 -XR/Developer/SDKs/MacOSX10.4u.sdk
Free Pascal Compiler version 2.4.0rc1 [2009/10/24] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tt.pp
Assembling program
Linking tt
4 lines compiled, 0.1 sec

$ otool -L tt
tt:
   /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11)

As you can see, if linked against the 10.5 SDK (or against the 10.6 SDK, or against no specific SDK when compiling on 10.5 or 10.6), then the compatibility version of libiconv will be 7.0.0 instead of 5.0.0

That should not be the problem here, since Eugene said he is using -XR/Developer/SDKs/MacOSX10.4u.sdk

Eugene Kryukov

  • New Member
  • *
  • Posts: 15
Re: _HiShapeCreateEmpty not found
« Reply #7 on: November 16, 2009, 02:01:13 pm »
This is otool result:

   /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
   /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
   /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
   /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.6)
   /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
   /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
   /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
   /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.0.0)
   /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.0.0)
   /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)


Eugene Kryukov

  • New Member
  • *
  • Posts: 15
Re: _HiShapeCreateEmpty not found
« Reply #8 on: November 16, 2009, 02:05:16 pm »
linker error:
ld: unknown option: -no_implicit_dylibs

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #9 on: November 16, 2009, 02:26:32 pm »
linker error:
ld: unknown option: -no_implicit_dylibs

$ fpc -k-no_implicit_dylibs tt
Free Pascal Compiler version 2.2.4 [2009/04/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tt.pp
Assembling program
Linking tt
2 lines compiled, 0.8 sec
$ sw_vers
ProductName:   Mac OS X
ProductVersion:   10.5.8
BuildVersion:   9L31a
$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-85.2.1

Maybe this feature was only added in Xcode 3.1 and you have only Xcode 3.0 installed? On the other hand, I also have the iPhone SDK installed, and it's possible that this linker comes from there.


Jonas

Eugene Kryukov

  • New Member
  • *
  • Posts: 15
Re: _HiShapeCreateEmpty not found
« Reply #10 on: November 16, 2009, 02:57:52 pm »
Thanks, i update XCode and now ld link without error and executable work on Tiger.

Eugene

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #11 on: November 16, 2009, 02:59:46 pm »
Thanks, i update XCode and now ld link without error and executable work on Tiger.

I'm very glad to hear that, because until now I had no idea whether that feature would actually help solve this sort of problems.

Thanks for confirming that it works!

Eugene Kryukov

  • New Member
  • *
  • Posts: 15
Re: _HiShapeCreateEmpty not found
« Reply #12 on: November 16, 2009, 03:03:12 pm »
Also, with XCode update "-k-no_implicit_dylibs" not need. Compiled application work on tiger without this option.

Eugene

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 778
Re: _HiShapeCreateEmpty not found
« Reply #13 on: November 16, 2009, 03:05:21 pm »
Also, with XCode update "-k-no_implicit_dylibs" not need. Compiled application work on tiger without this option.
That's even better. So it seems that it was simply a bug in the SDK that they fixed.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
    • havefunsoft.com
Re: _HiShapeCreateEmpty not found
« Reply #14 on: November 16, 2009, 03:37:19 pm »
That's even better. So it seems that it was simply a bug in the SDK that they fixed.
It's strange, because Eugene seems to be the only person having this bug.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

 

TinyPortal © 2005-2018