keesverruijt / BR24radar_pi

OpenCPN radar plugin for Navico Broadband Radars (BR24, 3G, 4G models) [HISTORIC]
17 stars 26 forks source link

Build error in Windows VS2013 #252

Closed Hakansv closed 7 years ago

Hakansv commented 7 years ago

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

keesverruijt commented 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.

keesverruijt commented 7 years ago

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.

Hakansv commented 7 years ago

I've opencpn.lib in the build directory. It's created today from recent OpenCPN Github

keesverruijt commented 7 years ago

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.

keesverruijt commented 7 years ago

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.

keesverruijt commented 7 years ago

I didn't find that since this is not necessary on Mac, and optional on Linux.

Hakansv commented 7 years ago

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?

keesverruijt commented 7 years ago

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.

keesverruijt commented 7 years ago

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.

Hakansv commented 7 years ago

Very good. Works fine. What about a PR to OCPN Github with the changed ocpn_plugin.h?

keesverruijt commented 7 years ago

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:

screen shot 2017-08-06 at 22 26 18
Hakansv commented 7 years ago

-OK.

keesverruijt commented 7 years ago

OK the pull request has been created: https://github.com/OpenCPN/OpenCPN/pull/869

Hakansv commented 7 years ago

Fine, Then build error is fixed.