pere.noel
8/14/2006 2:18:00 PM
Daniel Harple <dharple@generalconsumption.org> wrote:
> Try linking against the framework using the -framework flag.
>
> $LDFLAGS << " -framework CoreFoundation".
fine thanks, it's ok now for the links, however i get a bus error at
runtime :
/Users/yvon/work/Ruby/Native/C/raliasfile_test.rb:8: [BUG] Bus Error
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.7.0]
From C => alias_path :
/Users/yvon/work/Ruby/Native/C/doc/Introduction_ANSI_C_html
the line 8 of raliasfile_test.rb being simply :
a=RAliasFile.new("/Users/yvon/work/Ruby/Native/C/doc/Introduction_ANSI_C
_html")
(just after "require 'osx/ralias/raliasfile'")
and on the C side :
VALUE m_raliasfile_init(VALUE self, VALUE alias_path)
{
printf("From C => alias_path : %s\n", StringValuePtr(alias_path));
rb_iv_set(self, "@alias_path", alias_path);
Boolean NO=(Boolean)Qfalse;
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
(CFStringRef)alias_path, 0, NO);
if (url != NULL) {
printf("From C => url != NULL\n");
}
return self;
}
from the printf(...) i know the error is certaiinly due to this line :
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
(CFStringRef)alias_path, 0, NO);
--
une bévue