• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C functions


  • Subject: Re: C functions
  • From: ChanMaxthon <email@hidden>
  • Date: Fri, 18 Oct 2013 11:58:46 +0800

You can certainly move everything into a library, also you can prevent executables from being stripped in Xcode.

Sent from my iPhone

> On 2013年10月18日, at 11:54, Charles Srstka <email@hidden> wrote:
>
> Loadable bundles and libraries don't get stripped. Executables, since they don't need to be loaded by another process, usually are.
>
> Charles
>
>> On Oct 17, 2013, at 10:51 PM, ChanMaxthon <email@hidden> wrote:
>>
>> Then, problem, how did Core Foundation bundle loading work?
>>
>> Sent from my iPhone
>>
>>>> On 2013年10月18日, at 11:49, Charles Srstka <email@hidden> wrote:
>>>>
>>>> On Oct 17, 2013, at 10:40 PM, Maxthon Chan <email@hidden> wrote:
>>>>
>>>> You actually can, by using dlsym(3) to resolve the symbol, cast it to the appropriate function pointer and call it.
>>>>
>>>> For example:
>>>>
>>>> int (*myfunc)(int, int) = dlsym(RTLD_DEFAULT, myfunc_name);
>>>> if (myfunc)
>>>>  printf(“%d”, myfunc(2, 3));
>>>> else
>>>>  fprintf(stderr, “error: cannot resolve symbol: %s”, myfunc_name);
>>>>
>>>> This works on all POSIX operating systems.
>>>
>>> You shouldn't rely on dlsym() working in production code. If the binary is stripped (as it is by default for release builds, I believe), it won't work.
>>>
>>> Charles
>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >C functions (From: Shane Stanley <email@hidden>)
 >Re: C functions (From: Charles Srstka <email@hidden>)
 >Re: C functions (From: Maxthon Chan <email@hidden>)
 >Re: C functions (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: C functions
  • Next by Date: Re: Converting views to use layer backing
  • Previous by thread: Re: C functions
  • Next by thread: Re: C functions
  • Index(es):
    • Date
    • Thread