Link error with build 3770

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.

Link error with build 3770

Postby naoki5 » Wed Jul 17, 2019 2:55 am

https://bitbucket.org/chromiumembedded/ ... ckStart.md
We have built CEF from source code referring to this page.
The branch is 3770.

My environment is
Windows 10 Pro 64bit (1809) Japanese
Visual Studio 2017 Version 15.9.13
Windows SDK Version 10.0.17763.0

The contents of the .bat file are as follows:

update.bat
set GN_DEFINES=proprietary_codecs=true ffmpeg_branding=Chrome is_official_build=true
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
python ..\automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --no-distrib --no-build --branch=3770 --force-clean --force-update

create.bat
set GN_DEFINES=proprietary_codecs=true ffmpeg_branding=Chrome is_official_build=true
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
call cef_create_projects.bat

Finally, I built "Release_GN_x86" using Ninja.
The build was successful and .lib and .dll files are created.

However, linking this library with my application results in a link error.
The application is a 32-bit application using MFC.

error messages
Code: Select all
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::ios_base::init(void *)" (?init@ios_base@__1@std@@IAEXPAX@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::basic_streambuf<char,struct std::__1::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@IAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: virtual __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::~basic_streambuf<char,struct std::__1::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@UAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: virtual __thiscall std::__1::basic_ostream<char,struct std::__1::char_traits<char> >::~basic_ostream<char,struct std::__1::char_traits<char> >(void)" (??1?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@UAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: virtual __thiscall std::__1::basic_ios<char,struct std::__1::char_traits<char> >::~basic_ios<char,struct std::__1::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@__1@std@@@__1@std@@UAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: class std::__1::basic_ostream<char,struct std::__1::char_traits<char> > & __thiscall std::__1::basic_ostream<char,struct std::__1::char_traits<char> >::operator<<(unsigned long)" (??6?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@QAEAAV012@K@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: class std::__1::basic_string<char,struct std::__1::char_traits<char>,class std::__1::allocator<char> > & __thiscall std::__1::basic_string<char,struct std::__1::char_traits<char>,class std::__1::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@QAEAAV123@II@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: virtual __thiscall std::__1::basic_iostream<char,struct std::__1::char_traits<char> >::~basic_iostream<char,struct std::__1::char_traits<char> >(void)" (??1?$basic_iostream@DU?$char_traits@D@__1@std@@@__1@std@@UAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__basic_string_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__basic_string_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: void __thiscall std::__1::basic_string<char,struct std::__1::char_traits<char>,class std::__1::allocator<char> >::push_back(char)" (?push_back@?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@QAEXD@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: void __thiscall std::__1::basic_string<char,struct std::__1::char_traits<char>,class std::__1::allocator<char> >::resize(unsigned int,char)" (?resize@?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@QAEXID@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: class std::__1::basic_ostream<char,struct std::__1::char_traits<char> > & __thiscall std::__1::basic_ostream<char,struct std::__1::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@__1@std@@@__1@std@@QAEAAV123@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: class std::__1::locale __thiscall std::__1::ios_base::getloc(void)const " (?getloc@ios_base@__1@std@@QBE?AVlocale@23@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: static class std::__1::locale::id std::__1::ctype<char>::id" (?id@?$ctype@D@__1@std@@2V0locale@23@A)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""private: class std::__1::locale::facet const * __thiscall std::__1::locale::use_facet(class std::__1::locale::id &)const " (?use_facet@locale@__1@std@@ABEPBVfacet@123@AAVid@123@@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: __thiscall std::__1::locale::~locale(void)" (??1locale@__1@std@@QAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: void __thiscall std::__1::ios_base::clear(unsigned int)" (?clear@ios_base@__1@std@@QAEXI@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""public: virtual __thiscall std::__1::basic_istream<char,struct std::__1::char_traits<char> >::~basic_istream<char,struct std::__1::char_traits<char> >(void)" (??1?$basic_istream@DU?$char_traits@D@__1@std@@@__1@std@@UAE@XZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual void __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::imbue(class std::__1::locale const &)" (?imbue@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEXABVlocale@23@@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual class std::__1::basic_streambuf<char,struct std::__1::char_traits<char> > * __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::setbuf(char *,int)" (?setbuf@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEPAV123@PADH@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual int __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::sync(void)" (?sync@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEHXZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual int __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::showmanyc(void)" (?showmanyc@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEHXZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual int __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::xsgetn(char *,int)" (?xsgetn@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEHPADH@Z)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual int __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::uflow(void)" (?uflow@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEHXZ)" は未解決です。
1>libcef_dll_wrapper.lib(cef_logging.obj) : error LNK2001: 外部シンボル ""protected: virtual int __thiscall std::__1::basic_streambuf<char,struct std::__1::char_traits<char> >::xsputn(char const *,int)" (?xsputn@?$basic_streambuf@DU?$char_traits@D@__1@std@@@__1@std@@MAEHPBDH@Z)" は未解決です。
1>libcef_dll_wrapper.lib(print_settings_ctocpp.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(render_handler_cpptoc.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(request_handler_cpptoc.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(x509certificate_ctocpp.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(browser_ctocpp.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。
1>libcef_dll_wrapper.lib(drag_handler_cpptoc.obj) : error LNK2001: 外部シンボル ""protected: void __thiscall std::__1::__vector_base_common<1>::__throw_length_error(void)const " (?__throw_length_error@?$__vector_base_common@$00@__1@std@@IBEXXZ)" は未解決です。


The build of the "3626" branch created in the same procedure in January does not cause a link error, and the application works properly.

I think these two points.
New version of Visual Studio
New CEF branch

How do I create a library that can be linked successfully?
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Re: Link error with build 3770

Postby magreenblatt » Wed Jul 17, 2019 8:00 am

The libcef_dll_wrapper needs to be built with the same runtime settings as your application. Create a binary distribution from your build, and see https://bitbucket.org/chromiumembedded/ ... braries.md
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Link error with build 3770

Postby naoki5 » Thu Jul 18, 2019 12:22 am

magreenblatt wrote:The libcef_dll_wrapper needs to be built with the same runtime settings as your application. Create a binary distribution from your build, and see https://bitbucket.org/chromiumembedded/ ... braries.md


I built my application using the /MT flag.
I built CEF with default settings, so the /MT flag should be used.
(I confirmed the contents of libcef_dll_wrapper.ninja.)
I think that both my application and my build CEF is same flag.
Are there any other possible causes?
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Re: Link error with build 3770

Postby Czarek » Thu Jul 18, 2019 1:15 am

Do cefclient and cefsimple applications build fine?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Link error with build 3770

Postby naoki5 » Thu Jul 18, 2019 1:37 am

Czarek wrote:Do cefclient and cefsimple applications build fine?


Yes, cefclient and cefsimple work fine.
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Re: Link error with build 3770

Postby Czarek » Thu Jul 18, 2019 1:44 am

Make sure you've copied correct .lib files including libcef.lib for the appropriate configuration (Release, Debug).

Also header files in the include/ directory.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Link error with build 3770

Postby naoki5 » Thu Jul 18, 2019 3:40 am

Czarek wrote:Make sure you've copied correct .lib files including libcef.lib for the appropriate configuration (Release, Debug).

Also header files in the include/ directory.

Is libcef.lib about libcef.dll.lib?
I copied libcef.dll.lib and libcef_dll_wrapper.lib to the library directory.
For my application and the 3626 branch I could build with these two .lib files.
I don't use Sandbox.
Do I still need more?

I copied header files from \code\chromium_git\chromium\src\cef\include.
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Re: Link error with build 3770

Postby Czarek » Thu Jul 18, 2019 4:25 am

You can compare your compiler flags and linker flags with cefclient. Google the error message as well:
https://www.google.com/search?q=error+l ... l&oq=&aqs=
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Link error with build 3770

Postby naoki5 » Tue Jul 23, 2019 2:33 am

Czarek wrote:You can compare your compiler flags and linker flags with cefclient. Google the error message as well:
https://www.google.com/search?q=error+l ... l&oq=&aqs=

I compared with cefclient's compiler/linker flag (cefclient.ninja).
I changed the settings and tried to build, but the link error will not disappear.

I also compared it with the CEF binary distribution cefclient, but I did not get any useful information.
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Re: Link error with build 3770

Postby naoki5 » Tue Jul 23, 2019 2:36 am

I'm concerned about the error message "std::__1".
Is this related to libc++?
https://bitbucket.org/chromiumembedded/ ... ink-errors

I compared libcef_dll_wrapper.ninja with the 3626 branch.
I built successfully with the 3626 branch.
I built my application successfully with the 3626 branch.

The 3770 branch's .ninja had more configuration related to libc++, so I removed that configuration to make it the same as the 3626 branch.
When I build with this .ninja, I have libcef_dll_wrapper.lib which does not cause a link error.
However, when I build an application with this .lib file, it becomes an .exe file that can not be launched.
Of course, .lib files that I built without removing the configuration will cause link errors.
naoki5
Expert
 
Posts: 107
Joined: Wed Jul 17, 2019 2:44 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 81 guests