[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Dynaloader, CW and Math64Lib



I would like to build a C library using Code Warrior 9(IDE 1.6):
For test, I make the following:

1.I have a small source code in C: 
>  int test (int x) {
>      return (2*x);
>  }

compile as a Library named TestCLib in Preferences:PPC Project, without
any
others libs in the project (this not build a Math64Lib, but a CW Lib,
the problem comes from here). Save these Lib in folder
lib:MacPPC:auto:TestCLib:
of my new MacPerl 5.1.4b2.

2.TestCLib.pm and test.pl are:
>  package TestCLib;
>  require Dynaloader;
>  @ISA = qw(DynaLoader);
>  @EXPORT = qw(test);
>
>  bootstrap TestCLib;
>  1;
>  __END__

>  #!/perl -w
>  use TestCLib;
>  $var = test(5);
>  print ">> $var\n";
>  __END__
until now, I think all is correct.

3.The test.pl script execution return:

>  # Can't load 'Hard Drive:MacPerl 5.1.4b2:lib:MacPPC:auto:TestCLib:TestCLib'\
>  for module TestCLib: # DynaLoader error [-2806, TestCLib].
>  File 'Hard Drive:MacPerl 5.1.4b2:lib:Dynaloader.pm'; Line 172
>
>
>  File 'Dev:Pseudo'; Line 2
>  # BEGIN failed--compilation aborted.
>  File '<AppleEvent>'; Line 2
(<AppleEvent>:I run perl scripts by BBEdit)

__-2806__ is a "fragment container format unknow" error.

For resume, the principal question is: how to build a Math64Lib format
library
with CodeWarrior? Does specifics librarys are required to link?
Does instruction @EXPORT = qw(test) in TestCLib.pm necessary?
And is it possible to put the Math64Lib and the .pm module in the same
folder?
If not, why the lib:MacPPC:auto:... folder of Perl is an obligation to
store?

----------------
Olivier, Utkala
mailto:mask@hrnet.fr

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch