SafeInt

Jul 18, 2014 at 1:05 AM
Edited Jul 18, 2014 at 1:19 AM
I am using the one of the sample provided by microsoft. Its a win32 application.
Then i installed the casablanca and used the my code written for rest webservices

I am getting following errors;

error C2872: 'SafeInt' : ambiguous symbol
error C2872: 'SafeIntException' : ambiguous symbol
error C2872: 'SafeIntNoError' : ambiguous symbol
IntelliSense: "SafeIntDivideByZero" is ambiguous
error C2872: 'SafeIntArithmeticOverflow' : ambiguous symbol
error C2872: 'SafeIntDivideByZero' : ambiguous symbol

Here is one of output from the build errors:

f:\3dprinting\apps\3dviewer\3dviewer\viewers\printpreview\packages\cpprestsdk.2.1.0\build\native\include\compat\safeint3.hpp(596): error C2872: 'SafeIntError' : ambiguous symbol could be 'f:\3dprinting\apps\3dviewer\3dviewer\viewers\printpreview\packages\cpprestsdk.2.1.0\build\native\include\compat\safeint3.hpp(519) : SafeIntError' or 'c:\program files (x86)\microsoft visual studio 12.0\vc\include\safeint.h(262) : msl::utilities::SafeIntError'
Coordinator
Jul 18, 2014 at 1:37 AM
Hi utsav_popli,

It looks like unfortunately the safeint.h from Visual Studio 2013 is conflicting with the one we downloaded from CodePlex. It looks like the author just has a new version coming out that mentions something about "Visual Studio compatibility header".

Can you open a new Issue for this please so that we fix or upgrade? Or you could try out yourself replacing and seeing if the new Beta release he has works as well.

Thanks,
Steve
Jul 18, 2014 at 1:51 AM
Edited Jul 18, 2014 at 10:16 PM
Is there any another way around of resolving this issue as i am already using the latest version from nuget packages ?, Like: Maybe If i compile my rest webservice code as Lib and then use it in my win32 program ?
Jul 18, 2014 at 9:13 AM
Edited Jul 18, 2014 at 9:33 AM
I anyhow resolved this issue by explicitly defining the path:

additional includes : c:/program file x86/microsoft sdks/cpp rest sdk for visual studio 2013/sdk/include

addition include libraries:
c:/program file x86/microsoft sdks/cpp rest sdk for visual studio 2013/sdk/lib
c:/program file x86/microsoft sdks/cpp rest sdk for visual studio 2013/sdk/bin

And by defining "casablanca120.lib" in linker->input->additional dependencies

It gives no error when i include header client:
#include "http_client.h"
but as soon as i call of http_client
http_client(L"www.bing.com");

My program crashes:

Debug Error !
R6010
-abort() has been called
Please try to debug the application

Here is additional information:
Problem signature:
Problem Event Name: APPCRASH
Application Name: 3DViewer.exe
Application Version: 0.0.0.0
Application Timestamp: 53c8d9fa
Fault Module Name: MSVCR120D.dll
Fault Module Version: 12.0.21005.1
Fault Module Timestamp: 524f7ce5
Exception Code: c0000005
Exception Offset: 0013a9e8
OS Version: 6.3.9600.2.0.0.768.101
Locale ID: 1033
Additional Information 1: 5861
Additional Information 2: 5861822e1919d7c014bbb064c64908b2
Additional Information 3: 80a7
Additional Information 4: 80a7ccd5015bce3d41120fe057d4f98f

AFter i debug here is the statement i received:
Unhandled exception at 0x76F22EEC in 3DViewer.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x00FEF524.
Jul 19, 2014 at 1:47 AM
Hello Steve, I installed the casablanca using the console with version 1.3.1 and it worked , no more safeint errors.
Thanks for the help !!