Closed Hakansv closed 7 years ago
You need to compile / generate / download the latest opencpn.lib since this now requires API 1.14. The documentation on the new OpenCPN site is completely buggered compared to the old one though so I don’t remember how to get this. Maybe search the forum?
On 6 Aug 2017, at 17:26, Håkan Svensson notifications@github.com wrote:
Hi Kees. Exiting development. Build errors in Windows though: 4> Creating library C:/Builds/OCPN/BR24radar_pi/build/Release/br24radar_pi.lib and object C:/Builds/OCPN/BR24radar_pi/build/Release/br24radar_pi.exp 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "void cdecl PlugInAISDrawGL(class wxGLCanvas *,class PlugIn_ViewPort const &)" (?PlugInAISDrawGL@@yaxpavwxglcanvas@@ABVPlugIn_ViewPort@@@z https://github.com/z) referenced in function "public: void thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@qaexaavwxpaintevent@@@z https://github.com/z) 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "class wxColour cdecl PlugInGetFontColor(class wxString)" (?PlugInGetFontColor@@ya https://github.com/ya?AVwxColour@@vwxstring@@@z https://github.com/z) referenced in function "public: void thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@qaexaavwxpaintevent@@@z https://github.com/z) 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "bool __cdecl PlugInSetFontColor(class wxString,class wxColour)" (?PlugInSetFontColor@@YA_NVwxString@@vwxcolour@@@z https://github.com/z) referenced in function "public: void __thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@qaexaavwxpaintevent@@@z https://github.com/z) 4>C:\Builds\OCPN\BR24radar_pi\build\Release\br24radar_pi.dll : fatal error LNK1120: 3 unresolved externals
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/canboat/BR24radar_pi/issues/252, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiJekrxndAoOVrfZoRL-Uw-dccfl_3vks5sVdsOgaJpZM4OuwqO.
I checked the pages referred to in https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:developer_manual:plugins:plugin_api:plugin_api_versions#plugin_pi_api_versions_and_opencpn_version_compatibility but they seem to point to old opencpn.lib files.
I've opencpn.lib in the build directory. It's created today from recent OpenCPN Github
Well, those are exactly the three new functions in the 1.14 API that the plugin now calls, so you're still using an old one somewhere.
Aww, crap, I forgot to add DECL_EXP to the definition in the three lines in ocpn_plugin.h. If you add those and recompile OCPN it will work. This is a bummer since it means we need to wait for another OCPN release cycle, or come up with a way of dynamically loading it.
I didn't find that since this is not necessary on Mac, and optional on Linux.
OK, but it's little above my head. We've two ocpn_plugin.h involved. One in OCPN and one in BR24Radar_pi. Where to add?
Can you give me an example how to? Or maybe change and merge in BR24 and I do the same in OCPN?
OK there is no workaround other than us delivering a copy of opencpn.exe -- the functions are optimized away by the MSVC compiler unless exported with the appropriate mojo.
I just pushed a new commit. Copy the ocpn_plugin.h from BR24radar_pi/src to OpenCPN/include, then compile OpenCPN with it, then copy opencpn.lib to your target directory in BR24radar_pi, then build the plugin.
Very good. Works fine. What about a PR to OCPN Github with the changed ocpn_plugin.h?
Yes, PR to OpenCPN coming up once I verify it works in Linux as well.
Do you get texts with the AIS targets on the PPI window:
-OK.
OK the pull request has been created: https://github.com/OpenCPN/OpenCPN/pull/869
Fine, Then build error is fixed.
Hi Kees. Exiting development. Build errors in Windows though: 4> Creating library C:/Builds/OCPN/BR24radar_pi/build/Release/br24radar_pi.lib and object C:/Builds/OCPN/BR24radar_pi/build/Release/br24radar_pi.exp 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "void cdecl PlugInAISDrawGL(class wxGLCanvas *,class PlugIn_ViewPort const &)" (?PlugInAISDrawGL@@YAXPAVwxGLCanvas@@ABVPlugIn_ViewPort@@@Z) referenced in function "public: void thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@QAEXAAVwxPaintEvent@@@Z) 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "class wxColour cdecl PlugInGetFontColor(class wxString)" (?PlugInGetFontColor@@YA?AVwxColour@@VwxString@@@Z) referenced in function "public: void thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@QAEXAAVwxPaintEvent@@@Z) 4>RadarCanvas.obj : error LNK2019: unresolved external symbol "bool __cdecl PlugInSetFontColor(class wxString,class wxColour)" (?PlugInSetFontColor@@YA_NVwxString@@VwxColour@@@Z) referenced in function "public: void __thiscall br24::RadarCanvas::Render(class wxPaintEvent &)" (?Render@RadarCanvas@br24@@QAEXAAVwxPaintEvent@@@Z) 4>C:\Builds\OCPN\BR24radar_pi\build\Release\br24radar_pi.dll : fatal error LNK1120: 3 unresolved externals