jkriege2 / JKQtPlotter

an extensive Qt5 & Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
http://jkriege2.github.io/JKQtPlotter/index.html
GNU Lesser General Public License v2.1
889 stars 190 forks source link

Most of the examples fail to launch with MSVC2019 + Qt5 environment #116

Closed waka4g closed 10 months ago

waka4g commented 10 months ago

After successfully building this excellent library using CMake, following the comprehensive documentation provided, I attempted to run the example applications. However, most of these applications fail to launch. (Exceptions are "jkqtptest_jkqtmathtext_simpletest.exe" and "jkqtptest_jkqtmathtext_test.exe". I was able to launch these two applications.)

Environment

Actual Behavior

After a successful build, tried to launch the example applications.

Additional Information

When attempting to launch the "jkqtptest_simpletest.exe" application via the debugger, an Access Violation error occurs. The debugger indicates that this issue arises at line 458 in the file "jkqtmathtexttools.cpp". A screenshot of the debugger output (sorry but in Japanese) is attached for reference.

Any guidance or suggestions to resolve this issue would be highly appreciated.

image

jkriege2 commented 10 months ago

Hi!

yes, I can confirm the problem ... very stange ... I don't see it with Qt6 though ... do you need to rely on Qt 5?

Best, JAN

waka4g commented 10 months ago

do you need to rely on Qt 5?

No, I don't. It's great news for me that this issue does not occur with Qt6. I will take this opportunity to migrate to Qt6!

Thank you very much.

jkriege2 commented 10 months ago

... I have to correct myself: interestingly this bug does not appear in Qt6 or gcc ... because I ound a problem in the code you screenshot above: Inside the functor a line JKQTMathTextFontSpecifier fontSpec; was mising ... so I don't know at all, why this code compiled, as the outside fontSpec instance should not be accessibly without a capture-clause ... ver strange ... anyways, I fixed the problem and the current master should be fine also with Qt5 and MSVC (at least it worked for me).

See https://github.com/jkriege2/JKQtPlotter/commit/ef07a02e9bb0a1697c7b6f96316c243980b46100 for the fix