realbasic-plugins
[Top] [All Lists]

Re: Incorporating existing C/C++ libraries into an RB Project. . .?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Incorporating existing C/C++ libraries into an RB Project. . .?
From: Dave Addey <listmail1 at dsl dot pipex dot com>
Date: Mon, 30 Jul 2007 23:19:41 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
Thread-index: AcfS97k+98ABCj7qEdy2NAAWy4bgWw==
Thread-topic: Incorporating existing C/C++ libraries into an RB Project. . .?
I do this in a dual way - using one location for debug, and another for the
built app:

  #if DebugBuild
    Const kHIDLib = "@executable_path/../../../libHIDUtilities.dylib"
  #else
    Const kHIDLib = "@executable_path/../Frameworks/libHIDUtilities.dylib"
  #endif
  
    Declare Function HIDGetFirstDeviceElement Lib kHIDLib(inDevicePtr as
integer, inElementTypeMask as integer) as integer
    
When I have built the final app, I copy the dylib inside the bundle and the
non-debugbuild line above finds the dylib.  When I am running in debug, the
code above looks for the same dylib, *alongside* the debug app.  This means
I don't have to build the app to test every time, and can still run in RB's
debug mode.

Dave. 

> From: Norman Palardy <npalardy at great-white-software dot com>
> Reply-To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot 
> com>
> Date: Mon, 30 Jul 2007 11:28:30 -0600
> To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
> Subject: Re: Incorporating existing C/C++ libraries into an RB Project. . .?
> 
> 
> On 30-Jul-07, at 11:16 AM, Michael Williams wrote:
> 
>> Gotcha,
>> 
>> So you're recommending going the "dylib" route as opposed to the
>> plugin route?  What kind of recommendations have you for actually
>> distributing the "dylib"?  Someone mentioned actually placing the
>> "dylib" in the RB package, I'm not terribly familiar with that
>> process, nor how to reference a self-contained library.
>> 
>> Michael
> 
> 
> you can use a "special" name for a dylib in OS X that permits you to
> locate it relative to the actual executable
> 
> instead of
> 
> Soft declare sub/function name lib "lib name" ....
> 
> use
>          Soft Declare Sub/function name Lib "@executable_path/../
> Frameworks/lib name" ....
> 
> and then in the OS X version you copy your dylib into the FrameWorks
> folder in the package
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>