CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Linking to MacOS X framework libs w/Inline::C

 



rsmah
newbie

Nov 26, 2001, 12:28 PM

Post #1 of 1 (620 views)
Linking to MacOS X framework libs w/Inline::C Can't Post

I'm trying to use some MacOS X framework based libraries in an Inline::C module. However, I've been unable to get any framework-based libraries to link with the module properly.

For example, the simple code below should link with the CoreServices
framework and give me access to the Gestalt() system call.

use Inline C => Config => LIBS => '-framework CoreServices';
use Inline C => Config => INC => '-I/Developer/Headers/FlatCarbon';
use Inline C => <<'END_OF_C_CODE';
#include <Gestalt.h>
int gestalt(char* name)
{
OSErr err;
OSType selector;
SInt32 result;
memcpy(&amp;amp;selector, name, sizeof(OSType));
err = Gestalt(selector, &amp;amp;result);
return result;
}
END_OF_C_CODE

$selector = shift @ARGV;
$result = gestalt($selector);
print $selector, " = ", $result, " (", pack("l",$result), ")\n";

However, I get the error message:

dyld: perl Undefined symbols:
_Gestalt

Now, I've tried to insert '-framework CoreServices' (where the Gestalt() function is located) in a variety of Inline::C configuration options,
including CCFLAGS, LDDLFLAGS and MYEXTLIB. All give me the exact same error.

Note that, when compiling a "normal" C program, all you have to do is
include -framework CoreServices to the args for cc and it works.

My gut tells me that this so-called problem has a rather simple solution.
However, I'm not familiar enough with the underlying guts XS or the MacOSX (darwin?) linking system to figure it out myself.

Can anyone help?

Cheers,
Rob


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives