1
Vote

Sample wont compile on VS2010 when EXCEL12 switch defined

description

Build errors out with:

ClCompile:
1> function.cpp
1>function.cpp(75): error C2220: warning treated as error - no 'object' file generated
1>function.cpp(75): warning C4800: 'const char *' : forcing value to bool 'true' or 'false' (performance warning)
1>function.cpp(76): warning C4800: 'const char *' : forcing value to bool 'true' or 'false' (performance warning)
1>function.cpp(100): error C2440: 'initializing' : cannot convert from '_FP' to 'xll::XFP<X>'
1> with
1> [
1> X=XLOPER12
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1> macro.cpp
1> Generating Code...
1>
1>Build FAILED.

comments

keithalewis wrote Aug 26, 2016 at 12:14 AM

Should be converting from _FP12, not _FP.

kfd wrote Aug 29, 2016 at 2:58 PM

Added this to header.h and changed offending function arg:

ifdef EXCEL12

define _FPX _FP12

else

define _FPX _FP

endif

Also turned off /WX compile option to remove the C2220 stuff.