[R] Problem with making dll under Windows

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Aug 3 15:10:26 CEST 2007


Please check that you have installed a suitable environment (tools, 
compiler etc.) as mentioned in the R Installation and Administration 
manual. Öooks like your version of Perl is corrupted.

I got with your C program:

d:\aaa>R CMD SHLIB dmypow.c
making dmypow.d from dmypow.c
gcc   -It:/R/include  -Wall -O3 -std=gnu99   -c dmypow.c -o dmypow.o
windres -I t:/R/include  -i dmypow_res.rc -o dmypow_res.o
gcc  -shared -s  -o dmypow.dll dmypow.def dmypow.o dmypow_res.o 
-Lt:/R/bin    -lR


Uwe Ligges



Albrecht, Dr. Stefan (APEP) wrote:
> Dear all,
>  
> I have problems to compile a DLL for Windows XP with R version 2.5.1 (2007-06-27).
> See output below:
>  
> C:\AZ_DATEN\C, C++\BE_speedup>R CMD SHLIB dmypow.c
> Goto undefined subroutine &DynaLoader::bootstrap_inherit at C:\Programme\R\R-2.5
> .1\share\perl/XSLoader.pm line 80.
> Compilation failed in require at c:/Programme/Perl/lib/IO/Handle.pm line 262.
> BEGIN failed--compilation aborted at c:/Programme/Perl/lib/IO/Handle.pm line 262
> .
> Compilation failed in require at c:/Programme/Perl/lib/IO/Seekable.pm line 101.
> BEGIN failed--compilation aborted at c:/Programme/Perl/lib/IO/Seekable.pm line 1
> 01.
> Compilation failed in require at c:/Programme/Perl/lib/IO/File.pm line 133.
> BEGIN failed--compilation aborted at c:/Programme/Perl/lib/IO/File.pm line 133.
> Compilation failed in require at C:\Programme\R\R-2.5.1\share\perl/FileHandle.pm
>  line 6.
> Compilation failed in require at C:\Programme\R\R-2.5.1\share\perl/R/Utils.pm li
> ne 6.
> BEGIN failed--compilation aborted at C:\Programme\R\R-2.5.1\share\perl/R/Utils.p
> m line 6.
> Compilation failed in require at C:\Programme\R\R-2.5.1/bin/SHLIB line 24.
> BEGIN failed--compilation aborted at C:\Programme\R\R-2.5.1/bin/SHLIB line 24.
>  
> The file DynaLoader.pm is in the same directory as, e.g. XSLoader.pm
>  
> The c-file itself is very simple:
> #include <Rinternals.h>
> #include <math.h>
>  
> SEXP mypow(SEXP lifeFund, SEXP bow)
> {
>  int i;
>  double n;
>  
>  n = length(lifeFund);
>  for (i=0; i<n; i++)
>   REAL(lifeFund)[i] = pow((i+1)/n,REAL(bow)[0]);
>  return(lifeFund);
> }
> 
> Could anybody help, please?
>  
> With many thanks and best regards,
> Stefan
>  
> ____________________________________
> Dr. Stefan Albrecht, CFA
> Allianz Private Equity Partners GmbH
> Königinstr. 19 | 80539 Munich | Germany
> 
> Phone: +49.(0)89.3800.18317
> Fax: +49.(0)89.3800.818317
> EMail: stefan.albrecht at allianz.com <mailto:stefan.albrecht at allianz.com> 
> Web: www.apep.com <http://www.apep.com/> 
> 
> 
> Allianz Private Equity Partners GmbH | Geschäftsführung: Wan Ching Ang, Karl Ralf Jung
> Sitz der Gesellschaft: München | Registergericht: München HRB 126221 | Ust-ID-Nr.: DE 813 264 786
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list