Skip to content

App crash when linked with both Qxlnt and QWebWidget #19

@levente-levai

Description

@levente-levai

fix_expat_c_code.sh.txt
Maybe someone else might find this useful.
I use Qxlnt (many thanks for the author) with QWebWidget in my Qt app (Qt 5.15.2, to be precise). My problem was the app crashing with sigsegv (I used Linux, but I think the problem pops up on other platforms, too) when linked against libQxlnt.a. The chrash happens in the QApplication constructor in a function called XML_ParseBuffer.
After some scratching of my head and consulting the linker map it turned out that the culprit is the C code in Expat xml parser. Probably the names of the functions (starting with XML_) conflict with some functions in the QWebWidget and the linker adds these functions from libQxlnt. The solution was that I renamed all the C functions in

  • xlnt/third-party/libstudxml/libstudxml/parser.cxx
  • xlnt//third-party/libstudxml/libstudxml/details/expat/xmlparse.c
  • xlnt/third-party/libstudxml/libstudxml/details/expat/expat.h

For convenience I attached the bash script I used to do this patching. Run it from the xlnt directory.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions