libonvif icon indicating copy to clipboard operation
libonvif copied to clipboard

Building on Mint Ulyana / Ubuntu focal

Open alfem opened this issue 2 years ago • 1 comments

Hi!

I would like to test libonvif on my LinuxMint Ulyana. First at all Cmake 3.17 is required but only 3.16 is available.

I changed that setting in every CMakeLists.txt and then Cmake generated the makefiles without any warning.

Compilation and make install also run fine, but when I launch onvif-gui this error shows up:

Traceback (most recent call last):
  File "/home/alfem/.local/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/home/alfem/.local/lib/python3.8/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/home/alfem/.local/lib/python3.8/site-packages/gui/main.py", line 30, in <module>
    from gui.panels import CameraPanel, FilePanel, SettingsPanel, ModulePanel
  File "/home/alfem/.local/lib/python3.8/site-packages/gui/panels/__init__.py", line 1, in <module>
    from .camerapanel import CameraPanel
  File "/home/alfem/.local/lib/python3.8/site-packages/gui/panels/camerapanel.py", line 31, in <module>
    import libonvif as onvif
ImportError: dynamic module does not define module export function (PyInit_libonvif)

And onvif-util also throws an error:

onvif-util: error while loading shared libraries: libonvif.so.1: cannot open shared object file: No such file or directory

It is a big weird, as make install confirms the library is in place:

sudo make install
[ 71%] Built target libonvif
[100%] Built target onvif-util
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/lib/libonvif.so.1
-- Up-to-date: /usr/local/lib/libonvif.so
-- Up-to-date: /usr/local/bin/onvif-util
-- Up-to-date: /usr/local/include/x86_64-linux-gnu/onvif.h
-- Up-to-date: /usr/local/include/x86_64-linux-gnu/onvifboss.h
-- Up-to-date: /usr/local/share/man/man1/onvif-util.1

Any clues?

alfem avatar May 03 '23 12:05 alfem

Thank you so much for reaching out. I built a quick Linux mint setup, which worked ok, but it is the latest version, so there are probably some differences compared to what you are working with.

It looks like you should be able to run onvif-util, my guess is that you need to run sudo ldconfig to get the library running.

sudo ldconfig

To get onvif-gui working, please try going to the libonvif/onvif-gui folder and use the command python run.py and see if that brings up the application.

cd libonvif
mkdir build
cd build
cmake ..
make
cd ../../onvif-gui
python run.py

The program is set up to run off the local python binaries created by cmake, which should be in the build directory tree.

You may need to install some python dependencies to get started, i.e.

pip install pyqt6 numpy opencv-python loguru

Please let me know if you need further assistance

sr99622 avatar May 03 '23 14:05 sr99622