|go ahead... be a heretic|
"undefined symbols" on Mac OS Xby dakkar (Hermit)
|on Jul 05, 2003 at 16:12 UTC||Need Help??|
dakkar has asked for the
wisdom of the Perl Monks concerning the following question:
I have an iBook. It shipped with Mac OS X 10.1.something, and Perl 5.6.0. After "software update", fink, upgrade to 10.2, rinse, repeat, it now has 10.2.6, and still Apple's Perl 5.6.0.
Some time ago I started having problems with XS modules: they would compile, but in the test phase I would get "dyld: /usr/bin/perl Undefined symbols: _PERL_UNUSED_VAR", and Perl would "crash".
Google did not turn up anything useful (some "happened to me", "works for me" only), so I dived into the source of the modules and the various parts of the XS-to-C transformation.
I discovered that /Library/Perl/ExtUtils/ParseXS.pm inserts a "PERL_UNUSED_VAR(ax)" in some functions, presumably to stop gcc from complaining about unused arguments.
The problem is, that should be either a macro or a function: there is no macro defined with that name, so the compiler makes it a function call; there is no such function, so the loader dies at link-time.
For the moment I have "solved" the problem by commenting out that line, and everything seems to work.
Has anyone else experienced the same problem? (I did use super search)
Is what I did "right" in some sense, or is it going to cause problems?
-- dakkar - Mobilis in mobile
Most of my code is tested...