Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 18-03-2013, 11:12   #1
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
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, 17:16   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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 offline   Reply With Quote
Old 19-03-2013, 01:25   #3
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
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, 05:35   #4
Registered User

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

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

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
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 offline   Reply With Quote
Old 19-03-2013, 11:15   #6
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
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 offline   Reply With Quote
Old 20-03-2013, 07:11   #7
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
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, 11:23   #8
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 04:42.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.