Nov 26, 2001, 12:28 PM
Post #1 of 1
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.
Linking to MacOS X framework libs w/Inline::C
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';
int gestalt(char* name)
memcpy(&amp;selector, name, sizeof(OSType));
err = Gestalt(selector, &amp;result);
$selector = shift @ARGV;
$result = gestalt($selector);
print $selector, " = ", $result, " (", pack("l",$result), ")\n";
However, I get the error message:
dyld: perl Undefined symbols:
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?