Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Failed to use C++ Rest SDK and Microsoft unit test at the same time

$
0
0
I have a MFC project which uses C++ Rest SDK (Casablanca) under Visual Studio 2012 to implement an http client connection and it can be compiled well.
Then I add a Microsoft unit test project, but I can’t build the unit test project successfully.
In my main project, the environment is set as “Use MFC in a Static Library”, “No Common Language Runtime Support” and “Multi-threaded Debug (/MTd).” And my test project’s environment is same as main project. The error message shows:
“error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmtd.lib(newaop.obj).”
In addition, I also try to change the test project’s environment to “Common Language Runtime Support (/clr)” and “Multi-threaded Debug DLL (/MDd).” The original error disappears but new error comes:
“error C1189: #error : is not supported when compiling with /clr or /clr:pure. c:\program files (x86)\microsoft visual studio 11.0\vc\include\atomic line 9”
I do not know how to overcome these problems. Can anyone please give me some suggestions or resolutions? Thanks.

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>