Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when importing the CEF Python 47 module: undefined symbol: cef::logging::LogMessage #230

Closed
cztomczak opened this issue Jun 25, 2016 · 3 comments
Milestone

Comments

@cztomczak
Copy link
Owner

cztomczak commented Jun 25, 2016

Updated to CEF 47 in commit bc3b9aa - it builds fine, but there is this error when running example:

Traceback (most recent call last):
  File "wxpython.py", line 19, in <module>
    import cefpython_py27 as cefpython
ImportError: /home/czarek/github/cefpython/src/linux/binaries_64bit/cefpython_py27.so:
undefined symbol: _ZN3cef7logging10LogMessageC1EPKcii

Reported with details on the CEF Forum:
www.magpcss.org/ceforum/viewtopic.php?f=6&t=14269&p=31224

@allestuetsmerweh had the same issue when building idrissha's fork:
#195 (comment)

@sidreesshah Did you encounter the same issue when building newer CEF and if so how did you fix this?

@cztomczak
Copy link
Owner Author

This can be fixed by changing the order of libraries during linking in linux/setup/setup.py:

     libraries=[
+        'cefpythonapp',
         'cef_dll_wrapper',
         'client_handler',
-        'cefpythonapp',
         'cpp_utils',
         'gtk-x11-2.0',

cztomczak added a commit that referenced this issue Jun 26, 2016
Update automate.py - disable NACL and use sysroot, as per instructions
in cef/AutomatedBuildSetup.md.

Disable sandboxing for the subprocesses.

Update build-instructions for Linux.
@cztomczak
Copy link
Owner Author

Fixed in 03e9515

@cztomczak cztomczak added this to the Chrome 51 milestone Jun 28, 2016
jegger pushed a commit to rentouch/cefpython that referenced this issue Jun 29, 2016
It builds fine on Linux, however there is an error when running during import
of the cefpython .so module (Issue cztomczak#230).

Upstream CEF binaries and libraries are available for download from the
GH releases tagged 'v47-upstream'.

Changes in upstream CEF that break backward compatibility:
* Add Browser.NotifyMoveOrResizeStarted() - requires changes in examples,
  needs to be called in MOVE/SIZE window operations
* On Linux the windowRect argument in WindowInfo.SetAsChild() is now required
* When using offscreen rendering you must set the ApplicationSettings >
  "windowless_rendering_enabled" option to True
* New args in LifespanHandler.OnBeforePopup() - targetDisposition
  and userGesture - wxpython.py example updated
* New arg in RequestHandler.OnResourceRedirect() - request object, updated
  the wxpython.py example

Other changes in API:
* Change ApplicationSettings. Add new: user_data_path,
  windowless_rendering_enabled, persist_user_preferences, accept_language_list.
  Modify: background_color is now cross-platform (previously it was Mac only).
  Remove: release_dcheck_enabled - all examples updated
* Change BrowserSettings. Add new: windowless_frame_rate, background_color,
  accept_language_list. Remove: user_style_sheet_location,
  java_disabled, accelerated_compositing, author_and_user_styles_disabled.
* Add Browser.CloseDevTools()
* Remove Browser.ParentWindowWillClose()  in upstream (keep dummy for BC)
* Request.GetHeaderMap() will not include the Referer value if any
  and SetHeaderMap() will ignore Referer value
* Remove the cefpython.Request.Flags values: AllowCookies, ReportLoadTiming,
  ReportRawHeaders.
* Update descriptions of many functions and settings in API docs
* There were many more API changes in upstream, but are not yet implemented
  in cefpython. A list of changes since v31..v47 is available in the
  top comment in src/cefpython.pyx

Improve integration with PyCharm:
- add include "cefpython.pyx" in all .pyx files
- many other fixes

Set these settings in Pycharm:
- in Tool Windows > Project right click on src/cython_includes dir and
  select Mark Directory As > Mark as Sources Root
- PEP8 naming convention violation: ignored errors: N802, N803, N806
- in Inspections > unresolved references add to ignore: UNAME_SYSNAME
  and PY_MAJOR_VERSION and others that cause issues in PyCharm
- templates usage like CefRefPtr[CefApp] always shows "unresolved reference"
  error - to fix it add CefApp and others to ignore list (easy with alt+enter
  and fix single or fix all in file)

Remove duplicated comments in all C++ classes/methods that implement CEF API,
eg. client_handler.cpp and client_handler.h. Comments describing method
can be found in src/include/. Duplicating it might mislead when the comment
is not updated when updating to newer CEF.

Remove LOG macros in LOG_DEBUG.h - name conflicts with cef_logging.h
(issue cef/#1830).
cztomczak added a commit that referenced this issue Jul 2, 2016
Fix OnBeforePluginLoad and change args, see docs.

Add -std=gnu++11 flag to catch OVERRIDE errors.

Minor enhancements to makefiles.

Update build instructions - install python dependencies to make sure
that the right version of Cython is installed (must be exactly 0.19.2).
@cztomczak
Copy link
Owner Author

Previous commit didn't fix the issue, it still occured on some systems. Fixed again by adding -flto and a few other flags in commit 7d47bfe.

New flags:

    extra_compile_args=['-flto', '-fdata-sections', '-ffunction-sections',
                        '-std=gnu++11'],
    extra_link_args=['-flto', '-Wl,--gc-sections'],

More details on the flags here: https://stackoverflow.com/questions/6687630/

@cztomczak cztomczak changed the title Error when importing the CEF Python 47 module: undefined symbol: _ZN3cef7logging10LogMessageC1EPKcii Error when importing the CEF Python 47 module: undefined symbol: cef::logging::LogMessage Jul 2, 2016
@cztomczak cztomczak modified the milestones: v47, Chrome 50+ Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant