usage of base::Lock causes link errors

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.

usage of base::Lock causes link errors

Postby Abagian » Fri Jun 02, 2017 5:02 pm

Hi,

I have linking problems when trying to use base::Lock :

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "private: void __thiscall base::cef_internal::Lock::CheckUnheldAndMark(void)" (?CheckUnheldAndMark@Lock@cef_internal@base@@AAEXXZ) VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\VMCefHandler.obj 1
Error LNK2001 unresolved external symbol "private: void __thiscall base::cef_internal::Lock::CheckHeldAndUnmark(void)" (?CheckHeldAndUnmark@Lock@cef_internal@base@@AAEXXZ) VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\VMCefHandler.obj 1
Error LNK2001 unresolved external symbol "public: void __thiscall base::cef_internal::Lock::AssertAcquired(void)const " (?AssertAcquired@Lock@cef_internal@base@@QBEXXZ) VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\VMCefHandler.obj 1
Error LNK2001 unresolved external symbol "public: __thiscall base::cef_internal::Lock::~Lock(void)" (??1Lock@cef_internal@base@@QAE@XZ) VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\VMCefHandler.obj 1
Error LNK2001 unresolved external symbol "public: __thiscall base::cef_internal::Lock::Lock(void)" (??0Lock@cef_internal@base@@QAE@XZ) VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\VMCefHandler.obj 1
Error LNK1120 5 unresolved externals VMCefActiveX D:\WebRTC\ie_webrtc_plugins\CEF\abag\activex_demo\VMCefActiveX-2015\\out\ReleaseH264\videomostie.dll 1

I defined base::Lock lock_ in VMCefHandler or tried to use IMPLEMENT_LOCKING(VMCefHandler), in handler methods I used "base::AutoLock lock_scope(lock_);".

libcef_dll_wrapper.lib is in linker input dependences.

What was wrong ?
Abagian
Techie
 
Posts: 15
Joined: Wed Feb 08, 2017 1:55 pm

Re: usage of base::Lock causes link errors

Postby magreenblatt » Fri Jun 02, 2017 5:17 pm

What CEF version and Visual Studio version? Do the libcef_dll_wrapper compiler settings match your target settings?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: usage of base::Lock causes link errors

Postby Abagian » Mon Jun 05, 2017 5:30 pm

CEF branch is 2987. Visual Studio 2015 Version 14.0.25431.01 Update 3.
Target compiler settings - model is the same as for libcef_dll_wrapper, MT_Static (otherwise can't be linked at all).
Abagian
Techie
 
Posts: 15
Joined: Wed Feb 08, 2017 1:55 pm

Re: usage of base::Lock causes link errors

Postby hkurra » Fri Nov 03, 2017 1:46 am

I am also facing the identical issue on MAC for Release target only.
Any solution?
hkurra
Techie
 
Posts: 22
Joined: Wed Jun 21, 2017 8:13 am

Re: usage of base::Lock causes link errors

Postby magreenblatt » Fri Nov 03, 2017 12:41 pm

hkurra wrote:I am also facing the identical issue on MAC for Release target only.
Any solution?

What CEF version, macOS version and Xcode version? Do the CEF sample applications build successfully for you?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: usage of base::Lock causes link errors

Postby hkurra » Thu Dec 21, 2017 8:26 am

Sorry for the Late reply!

Fixed it by adding '-DNDEBUG' under Other C++ flags options for release target like we have in all sample client Xcode Project.
hkurra
Techie
 
Posts: 22
Joined: Wed Jun 21, 2017 8:13 am

Re: usage of base::Lock causes link errors

Postby michaeladamkatz » Tue Mar 20, 2018 1:50 am

Just reporting that I had the same issue on Windows. It appeared because I had removed the NDEBUG preprocessor flag from the cefclient project in Visual Studio. Removing that flag also from the libcef_dll_wrapper project also fixed the problem.
michaeladamkatz
Mentor
 
Posts: 50
Joined: Wed Jan 09, 2013 5:10 pm

Re: usage of base::Lock causes link errors

Postby magreenblatt » Tue Mar 20, 2018 12:19 pm

You should define NDEBUG for Release builds on all platforms.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 45 guests