Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-02-2016, 10:15   #466
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

For Plugin Internationalization see
Plugin Languages | Official OpenCPN Homepage
__________________

__________________
rgleason is offline   Reply With Quote
Old 09-02-2016, 14:46   #467
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,686
Re: Development Debugging Environment - Setup Help

Rick.
A little correction or add: Pavel "owns" OpenCPN Crowding and both he and bcdcat will of course maintain Crowdin. I've offer my help to relieve the pressure on them in this matter. So I'll of course do what I can whenever possible and needed.

What a plugin developer has to do is give us a message whenever the code is ready enough to update Crowdin, that's the main issue. If potfiles.in and the xxx_pi.pot is also updated in source it's very fine. But the message to any or all of us is the main task.

Then we will try to watch Crowdin for updated translations but a forum note from translators is of course also appreciated.

Håkan
__________________

__________________
Hakan is offline   Reply With Quote
Old 07-06-2016, 07:44   #468
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Debug is missing dll's -cairo.dll expat.dll

I am trying to debug weather_routing_pi because it is not working in Windows, using a github local repository for OpenCPN v4.2.1 and after Building, then hit Debug and I get messages that I am missing cairo.dll and several other dll's.

Yet I do have those under buildwin directory and I have downloaded and unpacked the full package needed.

Where should I be putting these files?
I always seem to get that screwed up.

Also Debug was asking for lib files too... but I think that has gone away.
__________________
rgleason is offline   Reply With Quote
Old 07-06-2016, 19:03   #469
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 3,210
Re: Debug is missing dll's -cairo.dll expat.dll

Quote:
Originally Posted by rgleason View Post
I am trying to debug weather_routing_pi because it is not working in Windows, using a github local repository for OpenCPN v4.2.1 and after Building, then hit Debug and I get messages that I am missing cairo.dll and several other dll's.

Yet I do have those under buildwin directory and I have downloaded and unpacked the full package needed.

Where should I be putting these files?
I always seem to get that screwed up.

Also Debug was asking for lib files too... but I think that has gone away.
Put this in a .bat file (I call mine dbcopy.bat) in the build directory.

Code:
@echo off
@echo "Copying gtk dlls."
copy /Y .\debug\gtk\cairo.dll .\debug
copy /Y .\debug\gtk\fontconfig.dll .\debug
copy /Y .\debug\gtk\pixman-1.dll .\debug
copy /Y .\debug\gtk\libpng16.dll .\debug
copy /Y .\debug\gtk\libxml2.dll .\debug
copy /Y .\debug\gtk\iconv.dll .\debug
copy /Y .\debug\expat-2.1.0\*.dll .\debug
@echo "Copying expat dlls."
copy /Y debug\expat-2.1.0\expat.dll .\debug
@echo "Copying chartdldr_pi.dll to .\plugins"
copy /Y plugins\chartdldr_pi\Debug\chartdldr_pi.dll .\plugins
@echo "Copying grib_pi.dll to .\plugins"
copy /Y plugins\grib_pi\Debug\grib_pi.dll .\plugins
@echo "Copying dashboard_pi.dll to .\plugins"
copy /Y plugins\dashboard_pi\Debug\dashboard_pi.dll .\plugins
@echo "Copying gecomapi_pi.dll to .\plugins"
if exist plugins\gecomapi_pi\Debug\gecomapi_pi.dll copy /Y plugins\gecomapi_pi\Debug\gecomapi_pi.dll .\plugins
@echo "Copying wmm_pi.dll to .\plugins"
copy /Y plugins\wmm_pi\Debug\wmm_pi.dll .\plugins
@echo "Copying vdr_pi.dll to .\plugins"
if exist ..\plugins\vdr_pi\build\Debug\vdr_pi.dll copy /Y ..\plugins\vdr_pi\build\Debug\vdr_pi.dll .\plugins
Run this after you build the debug version. I will put everything where it needs to be. I put all the plugins in the plugins folder under the base OpenCPN folder. You can add any other plugin dlls you build.

Note: This method avoids the common complaint that breakpoints can't be set in plugins.
__________________
transmitterdan is offline   Reply With Quote
Old 08-06-2016, 03:02   #470
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,686
Re: Development Debugging Environment - Setup Help

Dan.....
Nice tip and my adding here is maybe obvious but a possible helpful reminder:
If you change the code in one plugin be sure to:
-Build only "plugin"_pi for debug
-Run the .bat file to copy the new dll to \plugins
-Build entire OCPN for debug
__________________
Hakan is offline   Reply With Quote
Old 08-06-2016, 06:23   #471
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

Quote:
If you change the code in one plugin be sure to:
-Build only "plugin"_pi for debug
-Run the .bat file to copy the new dll to \plugins
-Build entire OCPN for debug
Hakan,
Do you build only the "plugin_pi" for debug, under MSVC++ by finding and selecting the "plugin_pi.sln" which is usually found under the plugin's build directory?

--How do you get the plugin_pi.sln into the 'build' directory? Don't you have to run "cmake -T v120_xp .." and "cmake --build . --config release' from the command prompt first? Probably easiest to do this on the entire local repository for all of opencpn?

I've been using the standalone version and building the debug version then copying the debug .dll over, but then there is the need for "data" directory etc. so I end up copying the entire standalone into the opencpn repos. I suppose I should be doing a git clone of the plugin from the plugins directory?
__________________
rgleason is offline   Reply With Quote
Old 08-06-2016, 09:02   #472
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,686
Re: Development Debugging Environment - Setup Help

Rick..
Sorry, it may be I misunderstood basics here. I was referring to my own method where I have the plugin inside OCPN repository beside Dashboard etc.
That's my way to be able to debug a plugin. But my case it's rather simple since I extend it with only one _pi, BR24....
I haven't tried to debug and breakpoint a plugin from outside O.

To get a plugin inside O's repository I (git)clone it at my "C:\Builds\OCPN\OpenCPN\plugins\".
Git will then handle that plugin individually and you can make local branches and commits.
The main OCPN Git will not handle every detail in the added plugin but you'll have to commit that "Something has happened" to the plugin. The disadvantage is you can't make a plugin only installation package from inside OCPN. For that you'll have to have also an "outside" plugin repository where you can implement your debugged changes from the "inside" plugin.

I'm not sure if I succeed to describe it understandable??
Håkan
__________________
Hakan is offline   Reply With Quote
Old 08-06-2016, 09:08   #473
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,686
Re: Development Debugging Environment - Setup Help

Rick...
This is then my OCPN repository:
Attached Thumbnails
Click image for larger version

Name:	O_repo.PNG
Views:	23
Size:	7.5 KB
ID:	125779  
__________________
Hakan is offline   Reply With Quote
Old 08-06-2016, 11:18   #474
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 3,210
Re: Development Debugging Environment - Setup Help

Hakan's method is what I also use. Develop/debug the plugin inside the OpenCPN tree. Then when it is in fully committed to git and ready for distribution, clone the repository to it's own tree outside of all other git structures. Then build the installation package from there.

It is easier for me to debug plugins this way and I don't have to modify the source code of OpenCPN as others have suggested. Their method works too but for me the method Hakan and I use seems "more natural".
__________________
transmitterdan is offline   Reply With Quote
Old 08-06-2016, 12:54   #475
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

Hakan and TDan that's very helpful. Thankyou.

Hakan, just a question about this:
The main OCPN Git will not handle every detail in the added plugin but you'll have to commit that "Something has happened" to the plugin.
--so MSVC++ will ask? for my affirmation? Or I "commit" something?
__________________
rgleason is offline   Reply With Quote
Old 08-06-2016, 13:05   #476
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

Hakan,

As well as cloning from the "C:\..github\OCPN\OpenCPN\plugins\"
you might be interested to know, that I can copy a standalone plugin into the plugin directory "C:\..github\OCPN\OpenCPN\plugins\" and rename it, and I can then use the MSV++ command prompt in that plugin under the "build" directory with cmake to make a debug dll that can be copied or even a release dll. Haven't tried making a release dll and then an executable with "cpack" but I think it might work.

I think I need to get a handle on this debug routine! and develop some better skills.
__________________
rgleason is offline   Reply With Quote
Old 08-06-2016, 13:18   #477
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

wxWidgets debug alert. If I hit "no" I can just continue.
Do you guys know what this is from? Can I just hit cancel and forget it happens?
The program seems to come up and run after that.
Attached Thumbnails
Click image for larger version

Name:	wxWidgets-Debug-alert.jpg
Views:	31
Size:	97.6 KB
ID:	125805  
__________________
rgleason is offline   Reply With Quote
Old 09-06-2016, 00:52   #478
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,686
Re: Development Debugging Environment - Setup Help

rick..
re: "--so MSVC++ will ask? f"
No, MSVC don't care for history, That's Git's task.

re:"As well as cloning from the "C:\..github\OCPN\OpenCPN\plugins\" ......... I can copy a standalone"
Yes, but if you use Git to clone it, from it's origin master, you'll have use of Git's features of history control and possibilities to back off any changes to prior stage.

re: "wxWidgets debug alert."
I use to cancel that one. Haven't seen any disadvantages.

And, yes, the debug/release dll's are always created for each plugin by MSVC builds and can be copied to use wherever you like. We were talking about the installation setup creation.

Normally I don,t use cmake for anything else than to create the build environment for MSVC. After big changes to the repository, like a new plugin, I may delete what's in \build and rerun cmake -T v120_xp .. and my bat file to copy all files and binaries needed for debug and release build. (Attached as an example - delete .pdf and edit path to fit your repo)
Håkan
Attached Files
File Type: pdf CopyFiles.bat.pdf (1.8 KB, 6 views)
__________________
Hakan is offline   Reply With Quote
Old 09-06-2016, 13:36   #479
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,829
Re: Development Debugging Environment - Setup Help

Jon's reply:
Quote:
You need to build the plugin with 'DEBUG' set in the mode at the top of the VC screen. You then need to copy the dll to the build_dir\plugins directory. I add the plugin project file to the solution package for opencpn (File/Add/Add existing project). Now you should be able to debug by running the main opencpn exec, i.e. just start debug.

I do this all in VM and sometimes have issues with screen redraws, particularly with opengl, but I can get by. You may not have these issues if you are using a native windows box.
__________________
rgleason is offline   Reply With Quote
Old 15-08-2016, 10:14   #480
Registered User

Join Date: Feb 2013
Location: Gothenburg, Sweden
Boat: Allegro 33
Posts: 194
Re: Development Debugging Environment - Setup Help

Hi!

I am trying to run VS2013 debugger on my gxradar_pi under OpenCPN-4.4.0 and I get no ethernet data on m_sock->RecvFrom().
Building the plugin by itself and installing it under OpenCPN-4.4.0 it works fine but not in Visual Studio.
Anyone got any idea ?

/Hans
__________________

__________________
hasse_A is offline   Reply With Quote
Reply

Tags
environment

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



Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 09:24.


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.