LNK2019 unresolved ostream << operator with 2062 branch

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

LNK2019 unresolved ostream << operator with 2062 branch

Postby Mayhew » Wed Sep 03, 2014 1:37 pm

I am updating to CEF revision 3.2062.1812 and am building my project with VS201s and am seeing the following errors. Note that these were not happening with my previous release branch 1916 builds. I don't see these in the test client but then again those don't seem to use CefXmlObject directly. I'm not sure if the LNK4221 is a red herring or not but that warning does not occur in the test client though it uses the VS2010 compiler.

I am still investigating but was hoping may someone had already seen this and had an easy fix.

cef_string16.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
libcef_dll_wrapper.vcxproj -> C:\src\build\Debug\lib\libcef_dll_wrapper.lib
libcef_dll_wrapper.lib(cef_xml_object.obj) : error LNK2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,wchar_t const *)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@PB_W@Z) referenced in function "public: bool __thiscall `anonymous namespace'::CefXmlObjectLoader::Load(class CefRefPtr<class CefStreamReader>,enum cef_xml_encoding_type_t,class CefStringBase<struct CefStringTraitsUTF16> const &)" (?Load@CefXmlObjectLoader@?A0xb4814bff@@QAE_NV?$CefRefPtr@VCefStreamReader@@@@W4cef_xml_encoding_type_t@@ABV?$CefStringBase@UCefStringTraitsUTF16@@@@@Z)


John
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: LNK2019 unresolved ostream << operator with 2062 branch

Postby magreenblatt » Wed Sep 03, 2014 1:43 pm

I'm not sure why this error is triggering all of a sudden but here's the fix which I'll commit shortly:
Code: Select all
Index: C:/code/chromium_git/chromium/src/cef/libcef_dll/wrapper/cef_xml_object.cc
===================================================================
--- C:/code/chromium_git/chromium/src/cef/libcef_dll/wrapper/cef_xml_object.cc   (revision 1812)
+++ C:/code/chromium_git/chromium/src/cef/libcef_dll/wrapper/cef_xml_object.cc   (working copy)
@@ -59,7 +59,7 @@
             } else {
               // Value following a child element is not allowed.
               std::stringstream ss;
-              ss << L"Value following child element, line " <<
+              ss << "Value following child element, line " <<
                   reader->GetLineNumber();
               load_error_ = ss.str();
               ret = false;
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: LNK2019 unresolved ostream << operator with 2062 branch

Postby magreenblatt » Wed Sep 03, 2014 1:46 pm

Fixed now in revision 1815.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: LNK2019 unresolved ostream << operator with 2062 branch

Postby Mayhew » Wed Sep 03, 2014 3:21 pm

Strange but that didn't work for me. Alos, the CEF Test App builds without that change. I wonder if there is some preprocessor macro that makes that compile without the change. I'm still looking.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: LNK2019 unresolved ostream << operator with 2062 branch

Postby Mayhew » Wed Sep 03, 2014 3:49 pm

Okay, I can repro the error in CefClient by adding the following to cefclient_win.cpp

Add this include
#include "include/wrapper/cef_xml_object.h"

Add this in wWinMain()
CefRefPtr<CefXmlObject> file_root(new CefXmlObject("ConfigurationFile"));

compile. This will fail even with the changes to cef_xml_object.cc
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: LNK2019 unresolved ostream << operator with 2062 branch

Postby Mayhew » Wed Sep 03, 2014 4:13 pm

My mistake, I misread the patch. That is the correct fix.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 62 guests