• 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
inline function problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inline function problems


  • Subject: inline function problems
  • From: Ken Tozier <email@hidden>
  • Date: Sat, 16 Oct 2010 23:31:16 -0400

Hi

I want to create some inline functions that are universally available within my app, but can't seem to get them working. If I define a set of inlines within a specific class, they compile, but If I take the same functions and move them to a dedicated "inlines" file and include that, it doesn't. The compiler spits out the following:

_UtilScaleRectSize", referenced from:
-[MyView initWithContainer:frame:] in MyVieww.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Here's what works when the inlines are defined for a specific class

static inline void UtilScaleRectSize(NSRect inRect, float inScale)
{
   inRect.size.width *= inScale;
   inRect.size.height *= inScale;
}

When moved to the dedicated "inlines" file, neither of these work, when defined in either '.h" or ".m" files

static inline void UtilScaleRectSize(NSRect inRect, float inScale)
{
   inRect.size.width *= inScale;
   inRect.size.height *= inScale;
}

inline void UtilScaleRectSize(NSRect inRect, float inScale)
{
   inRect.size.width *= inScale;
   inRect.size.height *= inScale;
}

Is there a way to define inline functions that can be used in any source file? Not just specific class files?

Thanks for any help

_______________________________________________

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

  • Follow-Ups:
    • Re: inline function problems
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Smooth scrolling in NSScrollView
  • Next by Date: NSRegularExpression only finds a single occurrence of my match
  • Previous by thread: Re: scaleUnitSquareToSize
  • Next by thread: Re: inline function problems
  • Index(es):
    • Date
    • Thread