From ripley at stats.ox.ac.uk  Wed Jan 30 19:06:17 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 30 Jan 2008 18:06:17 +0000 (GMT)
Subject: [Rd] The standalone Rmath library and VC++ 2003
In-Reply-To: <427B18C08050B745B13ADA8EE5A99D9A019769FC@MAIL03.bedford.progress.com>
References: <427B18C08050B745B13ADA8EE5A99D9A019769FC@MAIL03.bedford.progress.com>
Message-ID: <alpine.LFD.1.00.0801301754240.4291@gannet.stats.ox.ac.uk>

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



[Rd] The standalone Rmath library and VC++ 2003
Prof Brian Ripley