, , math.h.
, " msvcrt-ruby18-static.lib" DLL Visual Studio 2012 (VS2012). :
'unresolved external symbol __imp__hypot referenced in function _math_hypot'
, , " math.h".
:
double hypot(double _X, double _Y)
vs2010 dll, :
extern "C" __declspec(dllexport) double __cdecl hypot(...)
vs2010, :
static __inline double __CRTDECL hypot(...)
, VS2012 RC_INVOKED. , :
#define RC_INVOKED
#include <ruby.h>
extern "C" __declspec(dllexport)
double hypot(double x, double y)
{
if (x < 0) x = -x;
if (y < 0) y = -y;
if (x < y) {
double tmp = x;
x = y; y = tmp;
}
if (y == 0.0) return x;
y /= x;
return x * sqrt(1.0+y*y);
}
[ NOTICE ] My project is a DLL, and I use the dllexport keyword directly. It seems the prefix ' __ imp __ ' cannot be defined directly. I tried to define a function called __ imp__hypot (...) and I failed.
source
share