Bug 397557 - kmarkdownwebview gives "the shared library was not found" error
Summary: kmarkdownwebview gives "the shared library was not found" error
Status: RESOLVED FIXED
Alias: None
Product: kmarkdownwebview
Classification: Frameworks and Libraries
Component: kpart (other bugs)
Version First Reported In: 0.5.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 18:12 UTC by John S.
Modified: 2018-08-17 19:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John S. 2018-08-17 18:12:42 UTC
Using the latest source from Github, I compiled and installed kmarkdownwebview. After installing and setting kmarkdownwebviewpart at the top of the "Embedding" list for the Markdown file type, when I try previewing a Markdown file in Kate, the preview pane only contains a message: "The shared library was not found." I have checked to make sure the libraries were installed where the output of "sudo make install" claimed they were, and they have installed correctly.

System info:
Fedora 28
Kate 17.12.2
Comment 1 Friedrich W. H. Kossebau 2018-08-17 18:43:26 UTC
Sounds by that error text like the plugin location is not searched for by kate, that is seen usually in that case.

Where exactly have you installed the files, which prefix (e.g. what is the value of CMAKE_INSTALL_PREFIX)?

If you have not installed to the normal system path (/usr), you might need to also set the env var QT_PLUGIN_PATH to point to some base path where the actual plugin binary is (".../plugins").

Compare https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source#Set_up_the_runtime_environment for general notes.

Given you said you installed using "sudo", I assume though you want to install the plugin system wide. For that pass "-DCMAKE_INSTALL_PREFIX=/usr" to cmake, or consider forcing at least the kpart plugins into the Qt installation paths by using the cmake flag "-DKDE_INSTALL_USE_QT_SYS_PATHS=TRUE".

Plkease report if that solved your case (ideally including which paths you used, so I get a better idea about your problems and could extract something to add to the README.md) :)
Comment 2 John S. 2018-08-17 19:54:41 UTC
After (a lot of) testing, I've finally gotten it to work!

The default cmake prefix (not sure if this is machine-specific or if it's defined in the cmakelists files) was /usr/local. I tried setting it to /usr, but still got nowhere.

I realized I had been setting -DUSE_QTWEBKIT=TRUE unnecessarily too; I had first missed the part in the readme file about QtWebEngine being the default. Removing this flag still didn't fix anything.

The problem was fixed by configuring with -DKDE_INSTALL_USE_QT_SYS_PATHS=TRUE. After installing, Kate correctly displays the HTML version of the current Markdown document.

The plugin still doesn't work for previews with Dolphin, but I can live without those. This particular bug has been resolved.
Comment 3 John S. 2018-08-17 19:56:49 UTC
In case it's helpful for future development, here are the install locations I got using that cmake flag, taken from the install log:

Install the project...
-- Install configuration: ""
-- Installing: /usr/lib64/libKMarkdownWebView.so
-- Installing: /usr/lib64/qt5/plugins/kmarkdownwebviewpart.so
-- Set runtime path of "/usr/lib64/qt5/plugins/kmarkdownwebviewpart.so" to ""
-- Installing: /usr/share/kservices5/kmarkdownwebviewpart.desktop
-- Installing: /usr/share/metainfo/org.kde.kmarkdownwebviewpart.metainfo.xml
-- Installing: /usr/lib64/qt5/plugins/kmarkdownwebviewthumbnail.so
-- Set runtime path of "/usr/lib64/qt5/plugins/kmarkdownwebviewthumbnail.so" to ""
-- Installing: /usr/share/kservices5/kmarkdownwebviewthumbnail.desktop