Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 20-02-2017, 13:50   #541
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
6 Running OpenCPN from the build directory

@Hakan. Thank you. Regarding the earlier problem with not having the WMM plugin available in from within Studio ++ (Debug or Release) yet having Dashboard, ChartDownloader and Grib plugins. The wmm.dll was not in the C:\Users\..\GitHub\OpenCPN\build\plugins directory! Once the release version of wmm.dll was copied there it showed up under Options > Plugins.

=====

I've been trying to configure
https://opencpn.org/wiki/dokuwiki/do...out_installing

6 Running OpenCPN from the build directory (without installing)

And have followed the manual carefully, adjusting an older installation.
from the command prompt:
C:\Users\..\GitHub\OpenCPN\build\release> opencpn.exe /p
works fine. However after the portable version creates the opencpn.ini file in that directory, I should be able to use simply "opencpn.exe" from the same directory, but I get no Toolbar Icons showing and these warnings:

Quote:
Warning Unknown Image Data Format
and then

Quote:
wxWidgets Debug Alert
X ..\..\src\msw\bitmap.cpp(922): assert "image.IsOK()" failed in wxBitmap:CreateFromImage():invalid image. Do you want to stop the program? You can also choose [Cancel] to suppress further warnings. Yes No Cancel
Have I missed some file in the list, or is there some other file(s) I am missing. This looks sort of like an SVG image type problem to me.

Any suggestions would be welcome. (Note, I have an environment path to the wxWidgets.)

I also note that if you want plugins to work the files must be located under that same directory under "plugins" directory.

I attach a most recent opencpn.log.doc
Attached Files
File Type: doc opencpn.log.doc (3.4 KB, 28 views)
rgleason is offline   Reply With Quote
Old 20-02-2017, 14:10   #542
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Development Debugging Environment - Setup Help

Yes, TDan this would be great. Hakan's batch files might also help. Mike R. and I would like to document this thoroughly so others can help with debugging of plugins! and we have standard procedures for everyone. I need to do some debugging of Celestial Navigation and Weatherfax right now.

Quote:
It would improve efficiency if the VS build process used an end of build event in the debug build process to copy all required files (plugin dlls, etc.) to the proper directory under the build\debug tree. I was able to add that here and it saves a lot of head scratching. Also it eliminates the need to edit pluginmanager.cpp. VS is smart enough to know where the source file is so even by moving the debug build .dll file it will find the original source folder and you can set break points in the plugin before starting the OpenCPN debug executable.

Is anyone interested in trying to come up with a "standard debug scenario" for plugins built inside the O tree? If so, I will help. Would be good to ensure all plugins can be built this way. It takes a lot of time to test every plugin. And like weatherfax_pi some plugins don't build in the current development environment, would be good to fix that too.
PS: I still have pieces of files left over from testing during development of Svg and ncdf_pi, survey_pi etc. and I keep trying to clean those up. Don't know if I should be starting over again.
rgleason is offline   Reply With Quote
Old 20-02-2017, 14:31   #543
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Development Debugging Environment - Setup Help

Now I seem to have duplicates of files and directories under
C:\Users\..\GitHub\OpenCPN\build
C:\Users\..\GitHub\OpenCPN\build\release
C:\Users\..\GitHub\OpenCPN\build\Debug

Partially due to the recent changes I made to be able to
"Run Opencpn from the build directory (without installing)"

NOTE:
I haven't determined how big an advantage that is yet. Does someone know or have an opinion?

Which pushes all the files and directories down to the release & debug folders.

It would be nice to rationalize this structure so that we don't have duplicates everywhere, perhaps just in the
C:\Users\..\GitHub\OpenCPN\build\release
C:\Users\..\GitHub\OpenCPN\build\Debug
directories only?

and clean up the
C:\Users\..\GitHub\OpenCPN\build
directory?

But then, MS Visual Studio expects many of those files and directories.... maybe it can't be done.
rgleason is offline   Reply With Quote
Old 20-02-2017, 14:53   #544
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Running OpenCPN from the build directory

Running OpenCPN from the build directory

For DEBUG

After copying all the necessary files into
C:\Users\Frederick\Documents\GitHub\OpenCPN\build\ Debug

I found the same errors occur, when from the prompt,
I use "opencpn.exe".
rgleason is offline   Reply With Quote
Old 20-02-2017, 15:23   #545
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Development Debugging Environment - Setup Help

Here are lists of what is in my three directories:

PS:I do have a wxWidgets directory under debug and release with the wxwidget files needed.
Attached Files
File Type: doc build-list.doc (7.3 KB, 35 views)
File Type: doc build-release-list.doc (2.6 KB, 38 views)
File Type: doc build-debug-list.doc (2.3 KB, 26 views)
rgleason is offline   Reply With Quote
Old 21-02-2017, 03:33   #546
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Development Debugging Environment - Setup Help

Hasse_A Where is your data directory? Also are you still using c:/program_data/opencpn/plugins/weatherfax_pi for your downloaded images and coordinateSets,xml?
rgleason is offline   Reply With Quote
Old 21-02-2017, 14:19   #547
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Compiling Windows -run from build directory

6 Running OpenCPN from the build directory (without installing)

Quote:
Running for the first time To run the first time issue the following command from a command prompt in the build/Debug or build/Release directory:
opencpn.exe /p
After running opencpn.exe /p to create the ini, can anyone use just opencpn.exe successfully ? without getting
Quote:
Warning Unknown Image Data Format
rgleason is offline   Reply With Quote
Old 22-02-2017, 08:57   #548
Registered User

Join Date: May 2012
Posts: 1,205
Re: Development Debugging Environment - Setup Help

Weatherfax_pi again! Building under the OpenCPN source code with Visual Studio 2013.

Added the github source code to the OpenCPN source code.

Found the problem with 'ssize_t'. Google solution used - replace with 'intptr_t'.

Solved the 'Track.h' problem by explicitly giving VS2013 the path to that file for all the WFax code pages that used 'Track.h'. e.g. use c:\opencpn\plugins\weatherfax_pi\src\libaudiofile\ Track.h' instead of 'Track.h'.

Follow Sean's GitHub instructions about 'portaudio_x86.dll, portaudio_x86.lib, PVW32Con.exe'.

Running from 'Release' you would need to add 'portaudio_x86.dll' to the 'Release' folder. Add the 'weatherfax_pi.dll' plugin to a 'plugins' folder under 'Release'. A folder 'weatherfax_pi' under 'plugins'. This folder to have 'portaudio_x86.lib' and 'PVW32Con.exe' and a subfolder 'data' with the xml files.

Found a problem making an OpenCPN setup package but it did make an NSIS folder with all the files needed and I could run OpenCPN from that folder. No extra copying of files like 'libcurl.dll' was needed as it had been for 'Debug' and 'Release'.

Tested. It works!

Mike
Rasbats is offline   Reply With Quote
Old 22-02-2017, 09:38   #549
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Development Debugging Environment - Setup Help

Hakan at line 308 I don't see anything like this!
looking in Pluginmanager.cpp C:\..\GitHub\OpenCPN\src
Searches don't turn anything up.

Quote:
#if _DEBUG //Has for debug use #ifdef __WXMSW__ bool x; wxString f, volume, path, name, ext, mess; wxString destf, Dest = _T("C:\\Builds\\OCPN\\OpenCPN\\build\\plugins\\Deb ug_pi\\"); f = wxFindFirstFile(
rgleason is offline   Reply With Quote
Old 24-02-2017, 11:02   #550
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Can "Release" Plugins be run in MS VStudio while Debugging Opencpn?

Can "Release" Plugins be run in MS VStudio while Debugging Opencpn?

When I have "release" plugin .dll in the ..\build\plugin directory, I get continuous breaks and image errors instantly when I go to Options > Plugins. (Also copied the ..\plugin\[PIname]\Data\*.* directories to ..\build\plugins\[PIname]\data respectively.)

When I remove the 4 internal "release" plugin .dll from ..\build\plugins
MS VStudio ++ and Debugging Opencpn seems to work. The Option > Plugins directory shows and there are no plugins shown under it. There are no intant breaks and continuous breaks or image notices.

See the two attached docs. showing 2 separate events & documentation
First file has opencpn.ini and opencpn.log but second has more detail about the setup.

What am I missing here?
Attached Files
File Type: doc Break-when-Options-Plugins.doc (24.8 KB, 34 views)
File Type: doc Break2-when-use-Options-Plugins.doc (13.5 KB, 34 views)
rgleason is offline   Reply With Quote
Old 24-02-2017, 11:57   #551
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Another test of using Release dll with debug Opencpn

Tried copying dlls into ..\build\debug to see if Option > PLugins would work without the break and image problems.

No success. I am going to delete the dll's from ..\build\debug because debug is using the ..\build dlls.

See attached.
Attached Thumbnails
Click image for larger version

Name:	bitmap.cpp(922)imageIsOK-failed.jpg
Views:	79
Size:	278.1 KB
ID:	141890  
Attached Files
File Type: doc Break3-new-trail-with-dll-in-build-debug.doc (11.7 KB, 34 views)
rgleason is offline   Reply With Quote
Old 24-02-2017, 12:23   #552
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
"Release" Plugins CAN NOT be run in MS VStudio while Debugging Opencpn!!

NO
Pavel advises:
"Release" Plugins CANNOT be run in MS VStudio while Debugging Opencpn!!

Use only "debug" plugin dlls in ..\build\plugins\ when MS VStudio debugging Opencpn.

I guess this is where VDRplayer will be useful to run nmea files on debug versions of a plugin.

Thanks Pavel
rgleason is offline   Reply With Quote
Old 24-02-2017, 14:12   #553
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 559
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by rgleason View Post
Hasse_A Where is your data directory? Also are you still using c:/program_data/opencpn/plugins/weatherfax_pi for your downloaded images and coordinateSets,xml?
Sorry for not answering earlier. Been a bit buzzy prior to our Atlantic crossing.

My data directory is :
C:\ProgramData\opencpn\plugins\weatherfax

/Hans
hasse_A is offline   Reply With Quote
Old 27-02-2017, 10:11   #554
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Developer Manual - Compiling Windows

We are in the process of updating these Windows pages in the Developer Manual:

developer_manual:developer_guide:compiling_windows


developer_manual:developer_guide:compiling_windows :compiling_plugins_to_debug
rgleason is offline   Reply With Quote
Old 27-02-2017, 10:47   #555
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Question about NSIS Packaging

Quote:
On my machine I found a significant difference in the procedure for making Debug and Release versions of OpenCPN 4.5.215 when compared with the wiki. Visual Studio 2013 was being used.

https://opencpn.org/wiki/dokuwiki/do...piling_windows

The wiki has been edited with what I think are the steps needed (prefixed by 4.5.215).

Also the Package made with VS 2013 did not install several files in the root folder of OpenCPN. Files needed are also listed in the wiki. Does the NSIS script used by Package need amending?

Mike
Mike, I think I can answer fairly reliably that the NSIS Installer is configuring O and plugins just fine. I use it a lot. In fact I used the NSIS directory to check what is needed for the source\build\release directory.

If you have a chance to try the newly modified batch files in
Compiling Windows (previous note sent to you Tdan and Hakan) when you get a chance. I've been using the six git_opencpn.bat that I modified with success. I have also modified Hakan's CopyFiles.bat to be more complete but have not really used it that much, so that one does need further checking.

Also I've added a section for the batch files and reworked and added specifics for users trying to setup.

I hope this reads ok now, but you are welcome to edit for clarity and to make it simipler if possible.
rgleason is offline   Reply With Quote
Reply

Tags
environment


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 17:35.


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.