The R Project SVN R

Rev

Rev 51157 | Rev 73403 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51157 Rev 53374
Line 16... Line 16...
16
This file contains instructions for non-standard situations:
16
This file contains instructions for non-standard situations:
17
 
17
 
18
 - Using Microsoft Visual C++
18
 - Using Microsoft Visual C++
19
 - Using Borland C++
19
 - Using Borland C++
20
 - Using other compilers and languages
20
 - Using other compilers and languages
21
 - Cross-building packages on Linux
-
 
22
 
21
 
23
All the examples given here have worked at some point, but they are not
22
All the examples given here have worked at some point with 32-bit R,
24
tested for every R release.
23
but are mainly of historical interest.
25
 
24
 
26
 
25
 
27
Using Visual C++
26
Using Visual C++
28
================
27
================
29
 
28
 
Line 105... Line 104...
105
Using other compilers and languages
104
Using other compilers and languages
106
===================================
105
===================================
107
 
106
 
108
To use C++ see the section in the R for Windows FAQ.  You can include
107
To use C++ see the section in the R for Windows FAQ.  You can include
109
C++ code in packages and the supplied Makefiles will compile with g++
108
C++ code in packages and the supplied Makefiles will compile with g++
110
and link the DLL using g++ (and hence link against libstc++.a).  Use
109
and link the DLL using g++ (and hence link against libstdc++).  Use of
111
of C++ I/O may or may not work, and has been seen to crash R.
110
C++ I/O may or may not work, and has been seen to crash R.
112
 
111
 
113
To use F90 or F95, see `Writing R Extensions'.
112
To use F90 or F95, see `Writing R Extensions'.
114
 
113
 
115
For other compilers you will need to arrange to produce a DLL with
114
For other compilers you will need to arrange to produce a DLL with
116
cdecl (also known as _cdecl or __cdecl) linkage.  The MinGW port (and
115
cdecl (also known as _cdecl or __cdecl) linkage.  The MinGW port (and
Line 120... Line 119...
120
can produce cdecl DLLs by a suitable choice of flags, but if yours
119
can produce cdecl DLLs by a suitable choice of flags, but if yours
121
cannot you may need to write some `glue' code in C to interface to the
120
cannot you may need to write some `glue' code in C to interface to the
122
DLL.
121
DLL.
123
 
122
 
124
If you use .Fortran this appends an underscore and does no case
123
If you use .Fortran this appends an underscore and does no case
125
conversion at all to the symbol name.  It is normally best to use
124
conversion at all to the symbol name.  It is normally best to use .C
126
.C with compilers other than gfortran and map the name manually if necessary.
125
with compilers other than gfortran and map the name manually if
-
 
126
necessary.
127
 
127
 
128
Care is needed in passing character strings to and from a DLL by .C:
128
Care is needed in passing character strings to and from a DLL by .C:
129
they must be equivalent to the C type char** and null-terminated.  Not
129
they must be equivalent to the C type char** and null-terminated.  Not
130
even the MinGW g77 Fortran used null-terminated strings. (g77 was in
130
even the MinGW g77 Fortran used null-terminated strings. (g77 was in
131
GCC 3.x.y, superseded by gfortran.)
131
GCC 3.x.y, superseded by gfortran.)
Line 136... Line 136...
136
call to the C entry point Rwin_fpset().
136
call to the C entry point Rwin_fpset().
137
 
137
 
138
For some further details and Delphi examples see
138
For some further details and Delphi examples see
139
http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/
139
http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/
140
 
140
 
141
 
-
 
142
Feedback
-
 
143
========
-
 
144
 
-
 
145
Please send comments and bug reports to
-
 
146
 
-
 
147
	R-windows@r-project.org
-
 
148
 
-