seandepagnier / watchdog_pi

watchdog plugin for opencpn
GNU General Public License v3.0
10 stars 19 forks source link

plugin jailed on OpenCPN 5.6.0 due to undefined symbol #121

Closed marcobergman closed 1 year ago

marcobergman commented 2 years ago

Compiled from this source on Raspberry 4/Raspbian 10, OpenCPN 5.6.0 cannot load the plugin, with the following message in the opencpn log:

13:05:02.686 MESSAGE pluginmanager.cpp:2267 PlugInManager: Loading PlugIn: /home/pi/.local/lib/opencpn/libwatchdog_pi.so
13:05:02.689   ERROR dlunix.cpp:162 /home/pi/.local/lib/opencpn/libwatchdog_pi.so: undefined symbol: _ZN9wxControl7SetFontERK6wxFont
13:05:02.689 MESSAGE pluginmanager.cpp:2331    PlugInManager: Cannot load library: /home/pi/.local/lib/opencpn/libwatchdog_pi.so
13:05:02.690 MESSAGE pluginmanager.cpp:2335 Jailing: /home/pi/.local/lib/opencpn/libwatchdog_pi.so
marcobergman commented 2 years ago

Same error on Ubuntu 18, OpenCPN 5.2.4 but in this version the plugin is not jailed.

seandepagnier commented 2 years ago

Is it fixed now?

marcobergman commented 2 years ago

Yup seems to work on Raspberry. I have not checked at Ubuntu yet but I'll close the issue in good confidence.

marcobergman commented 2 years ago

Forgot to say I had to move src/WatchdogUI.h to include/ to make it compile

seandepagnier commented 2 years ago

does it work now?

seandepagnier commented 2 years ago

Which platform? What error did you get? It should just be in src

marcobergman commented 2 years ago

This is an openplotter image on a raspberry 4;

pi@openplotter:~/watchdog_pi/include $ mv WatchdogUI.h  ../src/
pi@openplotter:~/watchdog_pi/include $ cd ../build
pi@openplotter:~/watchdog_pi/build $ cmake ..

CMake Error at cmake/PluginSetup.cmake:27 (add_library):
  Cannot find source file:

    include/WatchdogUI.h

This prompted me to look for that file and move it to where is was expected to be.

see full output in attached file watchdog.txt

marcobergman commented 2 years ago

After all, it is the only .h file in the src directory...

marcobergman commented 2 years ago

Weirdly enough, with the change you made to PluginConfigure.cmake it compiles on my Ubuntu machine, but still the same error message on raspberry:

pi@openplotter:~/watchdog_pi/build $ grep -n include_directories ../cmake/PluginConfigure.cmake | head -n 2
134:    include_directories(${BUILD_INCLUDE_PATH}/include)
135:    include_directories(${BUILD_INCLUDE_PATH}/src)
pi@openplotter:~/watchdog_pi/build $ cmake ..
 ...
CMake Error at cmake/PluginSetup.cmake:27 (add_library):
  Cannot find source file:

    include/WatchdogUI.h
seandepagnier commented 2 years ago

did you delete the build directory and rerun cmake?

On 1/17/22, marcobergman @.***> wrote:

Weirdly enough, with the change you made to PluginConfigure.cmake it compiles on my Ubuntu machine, but still the same error message on raspberry:

***@***.***:~/watchdog_pi/build $ grep -n include_directories
../cmake/PluginConfigure.cmake | head -n 2
134:    include_directories(${BUILD_INCLUDE_PATH}/include)
135:    include_directories(${BUILD_INCLUDE_PATH}/src)
***@***.***:~/watchdog_pi/build $ cmake ..
 ...
CMake Error at cmake/PluginSetup.cmake:27 (add_library):
  Cannot find source file:

    include/WatchdogUI.h

-- Reply to this email directly or view it on GitHub: https://github.com/seandepagnier/watchdog_pi/issues/121#issuecomment-1014395646 You are receiving this because you commented.

Message ID: @.***>

jongough commented 2 years ago

The only changes you should have to make are to CMakeLists.txt in lines 152 - 162, this is where all the files for the project are defined. This area needs to reflect where the files are located, in this case WatchdogUI.h is in the src directory and not the include directory. So changing line 181 from include/WatchdogUI.h to src/WatchdogUI.h should be sufficient.

If you change other files that are provided by frontend2 then you will invalidate the update process for building and will no-longer be able to simply upgrade the building process by copying/replacing the requisite files. The failure that is happening is due to cmake being told that a file is in the project when it doesn't exist.

If you find issues with fronend2 then you need to make a pull request to the 'testpluing_pi' project, https://github.com/jongough/testplugin_pi, so that it can be incorporated into frontend2 and therefore not cause issues in the future.

marcobergman commented 2 years ago

did you delete the build directory and rerun cmake?

You're right - I cleaned the build dir and did a git pull, but the .h file must have been left in the include directory where I moved it to before. Still don't get why this is the only .h file in the src directory.

marcobergman commented 2 years ago

Having opened my eyes, I think line 181 is the culprit

image

EDIT: jongough beat me to it

rgleason commented 1 year ago

Marco, I think this is old and should be fixed in v2.4.70 although there are some other issues to be fixed. Please close.

marcobergman commented 1 year ago

Closed it, as I could see the change in CMakeLists.txt.

But could not check it because of my long standing nemesis: Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS). This one is going to be the death of me...

rgleason commented 1 year ago

marco isn't there a plugin in PIM?

marcobergman commented 1 year ago

Oh yeah there is, and no jails there!