How to compile BingRequest with common language runtime support?

Jan 16, 2014 at 4:06 PM
I am using Visual Studio 2010 and I need the option Common Language Runtime Support set to Common Language Runtime Support /clr. With /clr set I get some errors:

1>BingRequest.obj : error LNK2028: unresolved token (0A002DD5) "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall web::json::details::_String::as_utf8_string(void)const " (?as_utf8_string@_String@details@json@web@@$$FABE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "protected: virtual void __thiscall web::json::details::_String::format(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)const " (?format@_String@details@json@web@@$$FMBEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>BingRequest.obj : error LNK2028: unresolved token (0A002DD6) "private: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall web::json::details::_String::as_utf16_string(void)const " (?as_utf16_string@_String@details@json@web@@$$FABE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ) referenced in function "protected: virtual void __thiscall web::json::details::_String::format(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)const " (?format@_String@details@json@web@@$$FMBEXAAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>BingRequest.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall web::json::details::_Array::format(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)const " (?format@_Array@details@json@web@@MBEXAAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) 1>BingRequest.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall web::json::details::_Array::format(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)const " (?format@_Array@details@json@web@@MBEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>BingRequest.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall web::json::details::_Array::format(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?format@_Array@details@json@web@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) 1>BingRequest.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall web::json::details::_Array::format(class std::basic_ostream<wchar_t,struct std::char_traits<wchar_t> > &)const " (?format@_Array@details@json@web@@MBEXAAV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@@Z) 1>BingRequest.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall web::json::details::_String::as_string(void)const " (?as_string@_String@details@json@web@@UBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ) 1>BingRequest.obj : error LNK2019: unresolved external symbol "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall web::json::details::_String::as_utf8_string(void)const " (?as_utf8_string@_String@details@json@web@@$$FABE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "protected: virtual void __thiscall web::json::details::_String::format(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)const " (?format@_String@details@json@web@@$$FMBEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>BingRequest.obj : error LNK2019: unresolved external symbol "private: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall web::json::details::_String::as_utf16_string(void)const " (?as_utf16_string@_String@details@json@web@@$$FABE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ) referenced in function "protected: virtualvoid __thiscall web::json::details::_String::format(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)const " (?format@_String@details@json@web@@$$FMBEXAAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)


Without /clr enabled it is working fine.
Thanks,
Adrian
Jan 18, 2014 at 12:07 AM
Hi Adrian,

PPL and Casablanca don't support compilation with /clr. Also Casablanca only support two versions of Visual Studio at a time so that we can take advantage of newer C++ features. Right now we support VS 2012 and VS 2013.

Steve
Jan 22, 2014 at 2:14 PM
Hi Steve,

Thanks a lot for this elucidation. I will port everything someday to 2013 but now I don't have enough time to do that so I will use it as a dll with the /clr option disable and in the other project which is using this dll with the /clr option enable. It is working like that.

Adrian