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 09-04-2023, 11:17   #1
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Compile plugins ?

Until now, I was compiling some plugins in a simple way from its build/source code.
I usually do a "lite" build to get the dll which I then replace. Faster for me and it works perfectly. I'm compiling with VS 2017.

I currently see that the compilation is perfectly successful but I get a smaller dll than the one I want to replace.
And the consequence is that the modified plugin does not work with OCN.
I guess the evolution of OpenCPN could explain that I can no longer compile like before but I can't find any solutions.

What has changed and what must be done to still be able to compile a plugin?

Thanks in advance.
Schnapsy is offline   Reply With Quote
Old 09-04-2023, 11:20   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

Nothing changed in this respect, you can build the plugins from source as you always could.

As you do not say what you are actually doing exactly, we can't say what you are doing wrong.
nohal is online now   Reply With Quote
Old 09-04-2023, 11:44   #3
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

Thank you for answering.In fact, my way of doing it is very simple. (in this explication, "Plugin_Master" is an example.)

1. Launch the cmake-gui in: C:\Programs\CMake\bin
Put the source: C:/Plugin_Master
and the destination C:/Plugin_Master/build
then Generate ( => agree to create build )

2. Go to C:/Plugin_Master/build folder
Paste opencpn.lib in /build
and click on "name of the plugin".sln (to launch Visual Studio)

3. In visual Studio, click on properties of the "name of the plugin".pi
Then, in "Link/input editor", click on the scrollbar of "Additional dependencies" then on "Modify"
Add opencpn.lib again (write it), then OK, then apply.

In Visual Studio's menu bar, scroll down to show "Release" THEN "Build Solution".


The generation of the plugin is done perfectly, but the DLL obtained is smaller than the one I want to replace and OpenCPN crashes...
Schnapsy is offline   Reply With Quote
Old 09-04-2023, 11:50   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

Still far from enough information unfortunately...
What OpenCPN version are you trying to target? Do you have the correct wxWidgets libraries it is linked against? Where did you get the opencpn.lib file and are you sure it is correct for the OpenCPN version you are trying to target? What plugin?
nohal is online now   Reply With Quote
Old 09-04-2023, 12:05   #5
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

The affected plugin is tactics.pi
Indeed, I equipped myself with the Quark-Elec QK-AS08 three-axis Compass & Attitude Sensor.
The only problem with this device is that the XDR sentence for pitch & roll is of the format: $IIXDR,A,-21.5,D,AS08_ROLL,A,34.1,D,AS08_PITCH,*14
However, I want to obtain the following sentence: $IIXDR,A,-1.0,D,ROLL,A,-5.5,D,PITCH*5D, ie replace AS08_ROLL by ROLL.

Since this is an XDR sentence and there are other XDR sentences, I can't use the NmeaConverter plugin, so I just want to modify tactics_pi.cpp.

The version of OpenCPN is the latest (RC2), opencpn.lib was taken from a compilation I made of OpenCPN 5.6 (maybe that's where the problem lies), and the wxwidgets is well indicated in the environment path.
Schnapsy is offline   Reply With Quote
Old 09-04-2023, 12:12   #6
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

The problem can be pretty much anywhere as you are obviously not doing anything the same way we do. Starting with your toolchain.
The up to date build instructions for OpenCPN build on Windows are at https://opencpn-manuals.github.io/ma...8_0_fast_track and I really do suggest you follow them (Really only the Fast Track chapter). Once you have a consistent build of OpenCPN itself, move to the plugins (Using the same toolchain and same dependencies that were pulled for you when you built OpenCPN)
nohal is online now   Reply With Quote
Old 09-04-2023, 12:24   #7
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

Thank you for this link which I did not know and which seems very interesting.
I will study and test all this...
Schnapsy is offline   Reply With Quote
Old 10-04-2023, 08:58   #8
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

@nohal

I'm currently having trouble compiling with VS2022.
So I'm going to redo a complete installation, after cleaning my disk.
I just have a few questions...

1. In the case of a clean installation, is it necessary to install VS2017 in addition to VS2022?
2. I assume that in addition to installing VS2022, I also need to install all dependencies as stated for compiling with VS2017.

At the same time, in parallel, I will like to check if my initial problem is related to opencpn.lib or not.

Can you please provide me with a copy of the latest version of opencpn.lib ?
Thanks in advance.
Schnapsy is offline   Reply With Quote
Old 10-04-2023, 09:26   #9
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

You do not need VS 2017

The current official opencpn.lib is here: https://github.com/leamas/opencpn-li...i-18/msvc-wx32

You do not want to follow anything but the "5.8.0 Fast Track" chapter of the build instructions. As stated in the note just bellow it, the rest of that page is not yet updated. All the dependencies are pulled for you by running the buildwin\win_deps.bat script, there is no need to install them manually. For a plugin build, just point cmake to these.

I would probably not use dashboard_tactics_pi as the plugin on which I learn how the stuff currently works as not even I understand in what shape it currently is and what branch is supposed to be used. If you want something simple that we do know is usable, try for example https://github.com/nohal/nsk_pi to make sure you are able to build a plugin that is ready for O5.8.
nohal is online now   Reply With Quote
Old 10-04-2023, 09:46   #10
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

Thank you for this quick response.

Indeed, I had "thought" to understand that the dependencies are not necessary but I have a problem with 7zip which is not found when I launch "win_deps.bat", although I have registered the 7z. exe in the environment path.
(...)
https://github.com/OpenCPN/OCPNWindo...tags/v0.3.zip: Unknown/unsupported protocol.
'7z' is not recognized as an internal command
or external, an executable program or a batch file.
File not found - buildwin
0 file(s) copied

(...)
This problem is new, since I cleaned my disk.
But before, I already had a problem, that is to say that the build folder was created in the "OpenCPN\ci\" folder and not at the root of OpenCPN.

I will therefore take my time to redo everything correctly and I will also test the proposed plugin.
Thanks for your help.
Schnapsy is offline   Reply With Quote
Old 10-04-2023, 18:54   #11
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

I just provisioned a completely new Windows build environment from zero, all the steps taken are at https://gist.github.com/nohal/63d9ee...11ddf5182c0f50
nohal is online now   Reply With Quote
Old 11-04-2023, 03:14   #12
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

Yes, it seems like the download does not work on your machine. Are you sure you responded "yes" to every cocolatey query? Does wget work if you run it manually?
I'm afraid I can't help you much more, what I wrote in the gist is exactly what I did, not a single thing more was needed.
nohal is online now   Reply With Quote
Old 11-04-2023, 03:17   #13
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

Sorry, Nohal, I didn't see your reply and I destroyed the previous message.

Indeed, on another PC, the compilation works very well and it is thus well the PC on which I work which poses problem.

I'll clean it up, but in the meantime I can compile on another PC and that's the main thing.

Once again, congratulations on your tutorial!
Schnapsy is offline   Reply With Quote
Old 11-04-2023, 04:51   #14
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,236
Re: Compile plugins ?

The gist is now updated also with the instructions to build a plugin (one of mine, I can't guarantee it will be exactly the same for plugins from other developers, but it should give you a general idea)
nohal is online now   Reply With Quote
Old 21-04-2023, 14:10   #15
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 251
Images: 3
Re: Compile plugins ?

Nohal,

The compilation works perfectly.
But...

To compile the plugins, I first started - as advised - with the "DashboardSK_pi" plugin.
At the end of the compilation, in the "Release" sub-folder which is in the "Build" folder, I therefore obtain three files:
- DashboardSK_pi.dll
- DashboardSK_pi.exp
- DashboardSK_pi.lib

I thought it was enough to replace the original DLL (installed during the installation of the plugin) with the DLL obtained with the compilation.

But it doesn't work especially since the DLL obtained by compilation (631 Kb) is smaller than the original DLL (640 Kb).

Did I miss a step or do I still need to do something extra?
Schnapsy is offline   Reply With Quote
Reply

Tags
plug, plugin


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugins compile error stn92 OpenCPN 0 13-02-2017 09:30
Installateur de plugins, Install software for plugins. Gilletarom OpenCPN 3 30-04-2013 05:57
make package from a fresh compile: about files right?? manuprenlair OpenCPN 8 11-06-2012 22:44
Compile for Arm processor jimseng OpenCPN 6 28-04-2012 00:18
Fedora Compile Link Error oystercatcher OpenCPN 4 16-12-2010 15:37

Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 18:29.


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.