
rsmah
newbie
Nov 26, 2001, 12:28 PM
Post #1 of 1
(513 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;selector, name, sizeof(OSType)); err = Gestalt(selector, &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
|