[Rd] The standalone Rmath library and VC++ 2003

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 30 19:06:17 CET 2008


On Tue, 29 Jan 2008, Oran Johnson wrote:

> Linking my VC++ application with the standalone Rmath library yields the
> following;

Looks like you compiled the standalone Rmath library with MinGW.  You 
can't expect to mix-and-match compilers and link together a static library 
built under another compiler.

It is possible that this will work if you try linking to Rmath.dll: 
WIndows' DLLs are fairly portable (although parameter passing conventions 
do differ, and we know 'double complex' is not portable).  I assume you 
know how to make a VC++ import library from a DLL, which you would need to 
do.

If you compiled standalone Rmath under VC++, you would not have got a .a 
but a lib, at least by default.  You are welcome to try that: it has been 
done in the past but is not something we support (nor even would want to 
answer questions about).


> ------ Build started: Project: Complex plugin, Configuration: Debug
> Win32 ------
>
>
>
> Linking...
>
>   Creating library .\../Debug/complex_plugin.lib and object
> .\../Debug/complex_plugin.exp
>
> libRmath.a(mlutils.o) : warning LNK4217: locally defined symbol __iob
> imported in function _REprintf
>
> libRmath.a(dbeta.o) : error LNK2019: unresolved external symbol _log1p
> referenced in function _dbeta
>
> libRmath.a(qbeta.o) : error LNK2019: unresolved external symbol _log1p
> referenced in function _qbeta
>
> libRmath.a(lbeta.o) : error LNK2019: unresolved external symbol _log1p
> referenced in function _lbeta
>
> libRmath.a(toms708.o) : error LNK2001: unresolved external symbol _log1p
>
> libRmath.a(qbeta.o) : error LNK2019: unresolved external symbol _expm1
> referenced in function _qbeta
>
> libRmath.a(mlutils.o) : error LNK2019: unresolved external symbol
> ___fpclassify referenced in function _R_pow
>
> ../Debug/complex_plugin.dll : fatal error LNK1120: 3 unresolved
> externals
>
>
>
> Build log was saved at "file://c:\starting point\Debug\BuildLog.htm"
>
> Complex plugin - 7 error(s), 1 warning(s)
>
>
>
>
>
> ---------------------- Done ----------------------
>
>
>
>    Build: 0 succeeded, 1 failed, 0 skipped
>
>
>
> At first glance, it looks like C:\Rtools\MinGW\lib\libm.a is missing.
> After adding it to my project properties, the results are the same. It
> looks like VC++ is OK with GNU libraries because it appears to accept
> libRmath which was built on the same machine using Rtools. Also it does
> not appear to be a configuration issue, because it's only found
> 'C:\Rtools\MinGW\lib' and VC+ is complaining about not finding it.
>
>
>
> Any ideas?
>
>
>
> Oran
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list