jongough / testplugin_pi

Pluing to test JSON and ODAPI
GNU General Public License v3.0
3 stars 9 forks source link

Generating windows beta plugin fails #300

Closed LennartG-Sve closed 1 year ago

LennartG-Sve commented 1 year ago

I got a problem building Windows beta plugins for GPS Odometer and uploading to git from my ubuntu 20.04 system. Compiling locally using ubuntu 20.04 and TP v230 works just fine and the plugin executes without any errors on Linux. I don't have any Windows system so I rely on git -> beta -> AppVeyor.

However, the build process initiated thru AppVeyor, and referencing the beta upload I did four days ago, gave this error message. Both Windows versions (2017 and 2022) fails with the same message:

_C:\project\ocpn_project\build\Release\gpsodometer_pi.dll : fatal error LNK1120: 20 unresolved externals [C:\project\ocpn_project\build\gpsodometerpi.vcxproj] Command exited with code 1

jongough commented 1 year ago

If you are only using the build template there should be no TP code files needed. If you used TP as the basis for the code you will need to comment out, one by one, each of the files and see if it still builds/runs.

TP was built to test the ODraw API, both json and binary, before allowing others plugins to use it. I still use it for testing OD. However, with that in mind it shows a simple plugin that can be used as the basis of anyone else's plugin. More importantly, for some of us this is a templated build system that builds plugins for the plugin manager and most of the work is done in supplied cmake modules and *.in files leaving the developer/builder to change the CMakeLists.txt file only. I think this is a simpler approach for most plugins, but your mileage may vary.

As for the particular build that failed, they do sometimes due to failures to download files from the internet. The first thing to do is to re-run the failed build and see if it works. You can normally go into the list of builds in circleci and tell it to restart failed builds. This normally works. If not I would need to see what has failed to ascertain why.

LennartG-Sve commented 1 year ago

Jon, regarding your comments: 1/ 'build template', this is unknown to me, have though asked for such a thing before but to no avail. For the GPS Odometer I've used the complete TP as base and hence need to remove the files one-by-one. I will though download OD and compare, just as basic compare and information.

2/ I've seen the build problem before and I'm aware of the rerun option, no problem, Just another run will likely solve it. I will continue as is.

Thanks again.

rgleason commented 1 year ago

Guys, last night in my "update" branch, I reverted back to my 0.6.6.8 version which build and worked and then updated the opencpn.lib and ocpn_plugins.h files to be sure they were current (I hope I have them right). I then set for GPS-odometer version 0.6.6.9

set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")

and was able to build the plugin and it installed and tested ok. So it works using API 1.16

Then I changed the api version to "18" and the GPS-odometer version to 0.6.6.10 and was able to build the plugin and install it ok, but it quickly developed a bug when activated. Something about the API is not initialized right. Perhaps you will know what the fix is.

Screenshot (1463) Screenshot (1464) Screenshot (1465)

rgleason commented 1 year ago

Regarding Jon's comment. Last night I noticed that most of the files in ocpninclude are also added to GPS-odometer. which I thought odd. Here is a batch file that Jon provided for updating from the current testplugin template, which I find to be very useful and quick, so I don't even have to use the program WinMerge to compare folders and manually update the template. Lennart, perhaps you can use this list to winnow out the files not needed.

fe2xcopy.bat.txt

LennartG-Sve commented 1 year ago

Rick, the version 0.7.0.0 I have, and have uploaded to git' is using version API 1.18 and appears to work/compiles ok. Have however not restored the NMEA2000 functionality to test that part yet. Are currently trying to exclude 'not required TP stuff' and get a clean odometer/FE2.

The fe2xcopy.bat works just fine once you have FE2 up and running on the plugin. it is basically what I used before all this started. Converted it to Linux and ran it on my previous 0.7.0 version to get FE2 properly updated. It failed.

Dont spend more time on the .6 versions, those are retired.

rgleason commented 1 year ago

I used my version to "prove" that Ov 5.8 GPS-odometer builds as bdbcat wanted. However when using API 1.18 there is an issue.

Futhermore, you can use the fe2xcopy list to help you winnow out unnecessary files.

I am done with this now.

LennartG-Sve commented 1 year ago

Rick, sorry if I offended you in any way, that was not my intention.

A few messages up Jon gave this answer '_If you remove that (and any other unneeded parts of testpluginpi code) you may get a build that works.' I also replied that it did solve the problem and I'm sure that Dave has noticed that.

I have compared the script content and, as I said before, it sorts out the TP upgrades but I'm afraid that it does not fixes the problem with API versions. That has to be taken care of separately, which I have done in the current 0.7.0 version. I will soon upload another get version that hopefully works in all aspects.

LennartG-Sve commented 1 year ago

Guys, Success! After lots of work the GPS Odometer now compiles locally, on 'build-focal-gtk3', on VS2017 and on VS2022, all using API 1.18. Next step is to put back the NMEA2000 (socketCAN) functionality, test locally again and then compile the complete set.

Thanks for all assistance!

Leaving this open until I've added the last details.

rgleason commented 1 year ago

Good. No problem.

LennartG-Sve commented 1 year ago

Gyus, FYI: Version 0.7.0.1 of GPS Odometer is now in Cloudsmith Beta. It has all Linux and macos (apart from Jammy of course) as well as VS2017 and VS2022 built without errors. Tested Linux Focal tar.gz package on a second machine, works just fine including NMEA2000.

Appreciate if anybody feels like testing another package before releasing to prod.

Closing this and releasing to prod in two days or so unless I get error reports.

rgleason commented 1 year ago

Good job Lennart.

LennartG-Sve commented 1 year ago

No error messages received, apparently it works ok.

Holding back the prod version as a new TP version 232 with significant FE2 changes arrived. I will update to include those as well but closing this issue as problem is solved.

Thanks again for all assistance.