Use vscode to debug cefsimple.cc in ubuntu environment

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.

Use vscode to debug cefsimple.cc in ubuntu environment

Postby hsnowfox018 » Tue May 11, 2021 9:28 am

cef_binary_90.6.5+g7a604aa+chromium-90.0.4430.93_linux64.tar.bz2 used this binary to compile through cmake and also passed,
now I want to run cefsimple.cc through vscode, the g++ run error message seems to say that it was not found,
but I have included The header file and libcef_dll_wrapper.a and other files! I don’t know what went wrong?

tasks.json
Code: Select all
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++ 生成活动文件",
            "command": "/usr/bin/g++",
            "args": [
                "-g",
                "${file}",
                "-I/home/and/Work/cef/cef/cef_binary/",
                "-L/home/and/Work/cef/cef/cef_binarybuild/libcef_dll_wrapper  lcef_dll_wrapper",
                "-L/home/and/Work/cef/cef/cef_binary/Debug/  lcef",
                "-L/home/and/Work/cef/cef/cef_binary/Debug/  lEGL",
                "-L/home/and/Work/cef/cef/cef_binary/Debug/  lGLESv2",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}



err:
Code: Select all
Executing task: C/C++: g++ 生成活动文件 <

正在启动生成...
/usr/bin/g++ -g /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc -I/home/and/Work/cef/cef/cef_binary/ "-L/home/and/Work/cef/cef/cef_binarybuild/libcef_dll_wrapper  lcef_dll_wrapper" "-L/home/and/Work/cef/cef/cef_binary/Debug/  lcef" "-L/home/and/Work/cef/cef/cef_binary/Debug/  lEGL" "-L/home/and/Work/cef/cef/cef_binary/Debug/  lGLESv2" -o /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `(anonymous namespace)::SimpleBrowserViewDelegate::OnPopupBrowserViewCreated(scoped_refptr<CefBrowserView>, scoped_refptr<CefBrowserView>, bool)':
/home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:66: undefined reference to `CefWindow::CreateTopLevelWindow(scoped_refptr<CefWindowDelegate>)'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `SimpleApp::OnContextInitialized()':
/home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:83: undefined reference to `CefCurrentlyOn(cef_thread_id_t)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:83: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:83: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:86: undefined reference to `CefCommandLine::GetGlobalCommandLine()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:94: undefined reference to `SimpleHandler::SimpleHandler(bool)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:111: undefined reference to `CefBrowserView::CreateBrowserView(scoped_refptr<CefClient>, CefStringBase<CefStringTraitsUTF16> const&, CefStructBase<CefBrowserSettingsTraits> const&, scoped_refptr<CefDictionaryValue>, scoped_refptr<CefRequestContext>, scoped_refptr<CefBrowserViewDelegate>)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:114: undefined reference to `CefWindow::CreateTopLevelWindow(scoped_refptr<CefWindowDelegate>)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:126: undefined reference to `CefBrowserHost::CreateBrowser(CefWindowInfo const&, scoped_refptr<CefClient>, CefStringBase<CefStringTraitsUTF16> const&, CefStructBase<CefBrowserSettingsTraits> const&, scoped_refptr<CefDictionaryValue>, scoped_refptr<CefRequestContext>)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:83: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `SimpleApp::GetDefaultClient()':
/home/and/Work/cef/cef/cef_binary/tests/cefsimple/simple_app.cc:133: undefined reference to `SimpleHandler::GetInstance()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `base::subtle::Barrier_AtomicIncrement(int volatile*, int)':
/home/and/Work/cef/cef/cef_binary/include/base/internal/cef_atomicops_x86_gcc.h:92: undefined reference to `AtomicOps_Internalx86CPUFeatures'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `cef::logging::GetMinLogLevel()':
/home/and/Work/cef/cef/cef_binary/include/base/cef_logging.h:175: undefined reference to `cef_get_min_log_level'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `CefStringTraitsUTF16::clear(_cef_string_utf16_t*)':
/home/and/Work/cef/cef/cef_binary/include/internal/cef_string_wrappers.h:200: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `CefStringTraitsUTF16::to_string[abi:cxx11](_cef_string_utf16_t const*)':
/home/and/Work/cef/cef/cef_binary/include/internal/cef_string_wrappers.h:224: undefined reference to `cef_string_utf16_to_utf8'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/internal/cef_string_wrappers.h:228: undefined reference to `cef_string_utf8_clear'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `CefStringTraitsUTF16::from_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _cef_string_utf16_t*)':
/home/and/Work/cef/cef/cef_binary/include/internal/cef_string_wrappers.h:232: undefined reference to `cef_string_utf8_to_utf16'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `CefBrowserSettingsTraits::clear(_cef_browser_settings_t*)':
/home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:674: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:675: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:676: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:677: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:678: undefined reference to `cef_string_utf16_clear'
/usr/bin/ld: /tmp/cc1DRlX0.o:/home/and/Work/cef/cef/cef_binary/include/internal/cef_types_wrappers.h:679: more undefined references to `cef_string_utf16_clear' follow
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `scoped_refptr<CefWindow>::operator->() const':
/home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `scoped_refptr<CefBrowserView>::operator->() const':
/home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `scoped_refptr<CefBrowser>::operator->() const':
/home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `scoped_refptr<CefBrowserHost>::operator->() const':
/home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/cc1DRlX0.o: in function `scoped_refptr<CefCommandLine>::operator->() const':
/home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
/usr/bin/ld: /home/and/Work/cef/cef/cef_binary/include/base/cef_ref_counted.h:325: undefined reference to `cef::logging::LogMessage::~LogMessage()'
collect2: error: ld returned 1 exit status

生成已完成,但出现错误.
终端进程已终止,退出代码: -1。

终端将被任务重用,按任意键关闭。
hsnowfox018
Newbie
 
Posts: 8
Joined: Mon May 10, 2021 11:32 pm

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 34 guests