On Mar 13, 2006, at 3:35 PM, Garth Hjelte wrote:

At 02:52 PM 3/13/2006 -0600, you wrote:

> But I get an error in start the app in RB; "The application (null)
> could not be launched because of a shared library error:
> "R<main><main></Library/Application Support/ExtCompany/
> thislib.bundle><>"
>
> Perhaps it's because "thislib.bundle" is a Mach-O bundle and I
> can't get into it for the same reasons?

Right

When I look at thislib.sharedlib, it's a bundle. It only has one thing in it, in the MacOS folder, an app called thislib. So I pulled it out of the bundle and placed it where the bundle was. I called it from RB, and still I get the error.

An application is not a library. You can't declare into an application. Also, every bundle is not structured the same. You can read about bundles at the link I gave you.


or you can use Soft Declare ... instead of just Declare, and REALbasic will dynamically load it up.

I'm using RB5.5.4, so no Soft - but what difference would that make? WHEN it loads doesn't make a difference, does it? I don't understand why my RB app doesn't grab that exported function.

Soft declares are resolved at runtime, in a means that allows us to do the CFBundle work for you. Regular declares just "import" the functions from external libraries, and the application loader (part of the OS) is responsible for tying everything together.

I read your http://realbasic.maccoding.com/dylib.html, but that just deals with XCode and the example app is Mach-O.

Right. The only way declares work is against the same type of code the application is compiled for. Soft declares are a bit nicer, and can deal with more than regular declares can.

I know I can switch to all these things but right now I'm deal with something very small and it needs to be done quickly.

So, is it possible for RB 5.5 to call an external Mach-O compiled library? If so, what is wrong with the examples I provided?

Only if you compile a Mach-O application, write a plugin that uses CFBundle to dynamically load the framework, or use the MBS plugin which has SoftDeclareMBS (I've never used it personally, just know it exists).

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to