Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 18-03-2013, 10:12   #1
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Need help for plugins

in a plugin , when I call any of the cartographic functions as "DistanceBearingMercator" or "toSM" ... I get a LNK2019 error (external not resolved)
The other functions work well
any idea ?
many thanks
Jean Pierre
Ptizef is offline   Reply With Quote
Old 18-03-2013, 16:16   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: Need help for plugins

jp...

IIRC, you are on Windows?

Did you build the latest Windows release of 3.2.0, so that you have the correct export library available to your PlugIn?

That is an aggravation of Windows dll architecture. Linux, on the other hand, defers all dynamic library symbol resolution until runtime....

Dave
bdbcat is online now   Reply With Quote
Old 19-03-2013, 00:25   #3
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Re: Need help for plugins

Dave

Thanks for your answer.
Yes it's the the last 3.2.0 I tried to build .
As I wrote above ,when I call all functions as "GetChartbarHeight" or "JumpToPosition" etc.. , I have no problem .
The problem comes when I call all the cartographic ones . In fact all which don't use DECL_EXP _declspec(dllexport)

regards
Jean Pierre
Ptizef is offline   Reply With Quote
Old 19-03-2013, 04:35   #4
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Re: Need help for plugins

Sorry , I omitted :
Windows Vista - VS 2010
JP
Ptizef is offline   Reply With Quote
Old 19-03-2013, 06:51   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Need help for plugins

JP...
There would be nothing easier than looking at your code. It will probably reveal the cause much faster than this guesswork. So, github repo, please...

Pavel
nohal is online now   Reply With Quote
Old 19-03-2013, 10:15   #6
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: Need help for plugins

jp....

Ouch. This looks like a bug.

So, does it link OK if you modify ocpn_plugin.h, add the DECL_EXP to the georef function definitions, and rebuild?

Dave
bdbcat is online now   Reply With Quote
Old 20-03-2013, 06:11   #7
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Re: Need help for plugins

Dave

I rebuilt OpenCpn after having added DECL_EXP . To compile , I had to add it in both ocpn_plugin.h and georef.h and add the DECL_EXP define in georef.h, but at the end I succeed
Unfortunately , I got the same link error !
At that time , the only solution I found was to create a new function calling the original one in pluginmanager.cpp :

for example:

in ocpn_plugin.h I added :
extern "C" DECL_EXP void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist);

and in pluginmanager.cpp I added :
void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist)
{
DistanceBearingMercator( lat0, lon0, lat1, lon1, &*brg, &*dist);
}

and in the plugin I called DistanceBearingMercator_Plugin ... and it works


Pavel

I'll try to do that . Sorry I still do not control all the github possibilities.
But I don't think it's from my code because I just added a new instrument very similar to "_position" at the dashboard, working perfectly except when I call one of the georef functions

many thanks for your help

regards
Ptizef is offline   Reply With Quote
Old 21-03-2013, 10:23   #8
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Re: Need help for plugins

Hi

My code is at https://github.com/Ptizef/OpenCPN/
branch DASHBOARD_NO_COMPILE for the link error and branch DASHBOARD_WORKAROUND for the solution I found
regards
Jean Pierre
Ptizef is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 10:51.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.