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 08-06-2018, 07:25   #16
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Windows Compile Help

Quote:
Originally Posted by cryptik View Post
LOL... right. Here I have a working debugger now and did not think to actually use it. Okay, I will investigate that. I see lots of mentions regarding the log files, but I can't seem to find them. When you say log files, are these generated by OpenCPN while it is running... or a result of running the code in debug mode? I am still working my way through how this software works. I eventually want to start working on a plugin, but I want to get comfortable with the base software first.

Anyway, thanks so much for your help.
V/r
Ken
The logfile is generated by OpenCPN, regardless of being a Debug/Release build. Click on that fancy '?' icon in the toolbar and the location of your logfile and configile (also pretty important, especially if you want to mess with stuff while developing) will be shown on the last two lines.

Pavel
nohal is offline   Reply With Quote
Old 08-06-2018, 09:33   #17
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Okay, did some analysis on the log file... found a few things that I needed to fix in my debug setup...there are a few files that are not mentioned in the docs that need to be moved to the correct folders. I have notes that I could provide to anybody updating the online docs if needed. I am still researching why the chart downloader plugin is not loading.

The log file section is below. It seems it cant find the dll… but the dll is there and named correctly. My guess is there is something else wrong. It does find the other ones. I am going to run this in the debugger and set some breakpoints to see if I can figure it out. A good learning experience...lol.

11:41:49 AM: PlugInManager searching for PlugIns in location C:\projects\OpenCPN\build\plugins
11:41:49 AM: PlugInManager: Loading PlugIn: C:\projects\OpenCPN\build\plugins\chartdldr_pi.dll
11:41:49 AM: Error: Failed to load shared library 'C:\projects\OpenCPN\build\plugins\chartdldr_pi.dl l' (error 126: the specified module could not be found.)
11:41:49 AM: PlugInManager: Cannot load library: C:\projects\OpenCPN\build\plugins\chartdldr_pi.dll
11:41:49 AM: PlugInManager: Loading PlugIn: C:\projects\OpenCPN\build\plugins\dashboard_pi.dll
11:41:49 AM: C:\projects\OpenCPN\build\plugins\dashboard_pi.dll
API Version detected: 106
PlugIn Version detected: 102
11:41:50 AM: PlugInManager: Loading PlugIn: C:\projects\OpenCPN\build\plugins\grib_pi.dll
11:41:50 AM: C:\projects\OpenCPN\build\plugins\grib_pi.dll
API Version detected: 115
PlugIn Version detected: 401
11:41:50 AM: C:\projects\OpenCPN\build\plugins\grib_pi\data\gri b.svg
11:41:50 AM: PlugInManager: Loading PlugIn: C:\projects\OpenCPN\build\plugins\wmm_pi.dll
11:41:50 AM: C:\projects\OpenCPN\build\plugins\wmm_pi.dll
API Version detected: 108
PlugIn Version detected: 101
11:41:50 AM: WMM: WMM model data loaded from file C:\projects\OpenCPN\build\plugins\wmm_pi\data\/WMM.COF.
cryptik is offline   Reply With Quote
Old 08-06-2018, 09:36   #18
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Windows Compile Help

This means that some DLL is missing, but that DLL is not chartdldr_pi.dll, it is some of it's dependencies. As always on Windows, Dependency Walker (depends.exe) Home Page is your best friend here.

Pavel
nohal is offline   Reply With Quote
Old 08-06-2018, 19:55   #19
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,395
Re: Windows Compile Help

This looks suspicious:

11:41:49 AM: Error: Failed to load shared library 'C:\projects\OpenCPN\build\plugins\chartdldr_pi.dl l' (error 126: the specified module could not be found.)

Is that extra space "dl l" really there in the logfile? Some strange non-printing character?

Dave
bdbcat is offline   Reply With Quote
Old 11-06-2018, 08:01   #20
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Hey Dave, I took a look at the actual log file again... I am not sure where that space came from. The line in the log file does not have it (see below):

11:41:49 AM: Error: Failed to load shared library 'C:\projects\OpenCPN\build\plugins\chartdldr_pi.dl l' (error 126: the specified module could not be found.)
11:41:49 AM: PlugInManager: Cannot load library: C:\projects\OpenCPN\build\plugins\chartdldr_pi.dll

In any case, I followed pavel's advice and used dependency walker. I found that archive.dll (for debug in VS2013) needs to be copied to the debug folder with the other ones. Once it was found, then the chart downloader plugin worked fine in the debugger. I have attached a simple batch file that I use to copy the needed files over to support running opencpn in the debugger. It includes some files missing from the developer documentation... in case somebody else has similar problems down the road. I have also included a step-by-step set of directions.

(NOTE: remove the .doc extension from the file after download)
Attached Files
File Type: doc files.7z.doc (1.8 KB, 34 views)
cryptik is offline   Reply With Quote
Old 05-07-2018, 08:45   #21
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Things are moving along with plugin development but I am having an issue with the plugin package. I created a set of icons (following the "learning" article) and they work just fine when running OpenCPN 4.8.4 in debug mode. I can also create an install package and install them into a release version of OpenCPN 4.8.4 that is installed from the OpenCPN downloads.

The problem is that when running the plugin in the release version of OpenCPN, I get an error dialog with the warning "Warning: Unknown image data format". Once that is cleared, I then get another error dialog with the following:

..\..\src\msw\bitmap.cpp(922): assert "image.IsOk()" failed in wxBitmap::CreateFrom Image(): invalid image Do you want to stop the program? You can also choose [Cancel] to supress further warnings:

At this point, if I say No and continue to run the program, it works, but the toolbar does not show up. The log appears to load the plugin correctly But then generates an exception. This same log entry shows up when running in debug mode, but without the Caught exception.

11:30:43 AM: C:\Program Files (x86)\OpenCPN\plugins\DR2_pi.dll
API Version detected: 107
PlugIn Version detected: 101
11:30:43 AM: Warning: Caught MainLoopException, continuing...

Any ideas as to why this is happening? The icons are 32x32 PNG files with indexed color palette of 16 colors. They have a transparent background and the actual image is 29x29 pixels, leaving a three pixel transparent border as indicated in another forum post.

When running in debug, the plugin manager shows the correct icon with transparent background, but the toolbar shows the icon with a black background rather than transparent (or grey like the window). The icon file is transparent.

V/r
Ken
cryptik is offline   Reply With Quote
Old 05-07-2018, 09:04   #22
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Windows Compile Help

Ken...
Are you sure you are creating your install package from a release build of your plugin?
It would be much easier actually looking at your code than guessing what you might have not done right.

Pavel
nohal is offline   Reply With Quote
Old 05-07-2018, 12:06   #23
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

So that may be my problem. I am just using the DR plugin code from the "learning" thread. The only thing I modified was the name of the plugin (as described) and the icons. I then ran the perl script to generate the new icons... but my plugin package is based on debug code that is then installed in the release version of OpenCPN. I will build the release version of the plugin and that will probably fix it.
cryptik is offline   Reply With Quote
Old 05-07-2018, 12:44   #24
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Hi Pavel,

That was the problem. When I switched to building a release version of the plugin, it worked just fine. On interesting thing that I could not explain. The debug build links against opencpn-4-8-0.lib (located in the plugin build folder). And this file is added to the linker properties (dependencies). For the release build, even when adding opencpn-4-8-0.lib to the linker properties, it wants to link against opencpn.lib. I had to copy the opencpn-4-8-0.lib to opencpn.lib (again, in the build folder) and I could then build a release version. Not sure if this is normal... as I am new to VS and windows software.

v/r
Ken
cryptik is offline   Reply With Quote
Old 05-07-2018, 15:25   #25
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Windows Compile Help

Ken...
I still don't see your code, but if you use the standard cmake workflow as most of the other plugins, did you correctly modify PluginInstall.cmake to use your name for the library? If you did not, a lot of your manual modifications get overriden by cmake every time it gets invoked. All in all I don't see much reasons to invest effort into this matter.
I also almost always build and debug my plugins inside the opencpn tree especially on windows as it makes everything much easier, so need opencpn.lib only for creating the final setup package.

Pavel
nohal is offline   Reply With Quote
Old 06-07-2018, 16:55   #26
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Thanks for the help Pavel. The issue was that I needed to have a release plugin running in a release build of OpenCPN. That fixed the issue. I am using the cmake workflow from the DR plugin sample.

I do have another problem. I have the make files and such squared away as well as my wxwidgets interface. I have copied the nmea0183 folder from the opencpn source (4.8.4) into my plugin folder as well as the opencpn_plugin.h from the 4.8.4. I also updated the cmake files and regenerated the VS files to build. The code builds, but I get two link errors for unresolved externals...

Error 1 error LNK2001: unresolved external symbol "int g_NMEAAPBPrecision" (?g_NMEAAPBPrecision@@3HA) C:\projects\aismsg_pi\build\apb.obj aismsg_pi

Error 2 error LNK2001: unresolved external symbol "class wxString g_TalkerIdText" (?g_TalkerIdText@@3VwxString@@A) C:\projects\aismsg_pi\build\response.obj aismsg_pi

I am still plodding along here but not sure why these link errors are there. Do I have a mismatch in the code files? Its probably difficult to offer advice without seeing the full project code...but if anybody can point me in a direction, I can figure it out

V/r
Ken
cryptik is offline   Reply With Quote
Old 06-07-2018, 17:11   #27
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Windows Compile Help

Ken...
I still don't see your code

But this one is guessable without looking at it - You have copied https://github.com/OpenCPN/OpenCPN/b...83/apb.cpp#L43 and https://github.com/OpenCPN/OpenCPN/b...sponse.cpp#L43 and I would guess you don't declare those variables anywhere.

You would probably be happier with nmea0183 parser code copied from https://github.com/OpenCPN/OpenCPN/t...i/src/nmea0183 or any other plugin having a copy than from the core program.

Pavel
nohal is offline   Reply With Quote
Old 09-12-2018, 12:30   #28
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 559
Re: Windows Compile Help

Hi!

I am starting again to do debugging on the radar_pi now that I have come
back to the boat in the Caribbean.

Now, I am a bit confused of what version of things to use.
I want to use OpenCPN 4.8.8.
What version of VS should i use 2013 or 2017 ?
What version of wxWidgets should I use 3.0.2 or 3.1.1 ?

I have tried to use VS 2017 and wxWidgets-3.1.1.
Everything compiles ok if I exclude grip_pi.
But, starting to debug gives me libcurl.dll not found on the system even thou it exists in both release and debug dirs.

/Hans
hasse_A is offline   Reply With Quote
Old 09-12-2018, 15:28   #29
Registered User

Join Date: Jun 2018
Posts: 68
Re: Windows Compile Help

Hi Hans,

I am not sure about what the "official" answers are to your questions... but I am using the 4.8.8 version with VS2017 and wxWidgets 3.1.1. As you can probably tell from this thread, I have had lots of problems...but everything seems to be building okay to include the grib_pi plugin. With regard to the libcurl.dll error. The setup script I use to get 4.8.8 to work in VS2017 debugger first copies libcurl.dll from .\buildwin\libcurl.dll to .\build\Debug\libcurl.dll. I assume it is only needed in the target folder, but I am not sure. Can you see it in both places?

V/r
Ken
cryptik is offline   Reply With Quote
Old 09-12-2018, 16:25   #30
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 559
Re: Windows Compile Help

Thanks Ken....

So, now I get a bit further after copying libcurl.dll but now VS crashes on

The program '[9136] opencpn.exe' has exited with code -1073741701 (0xc000007b).

I had all running fine in VS 2013 but thought I would upgrade as there was a new guide for VS 2017. Maybe yhis was a bad idea.

/Hans
hasse_A is offline   Reply With Quote
Reply

Tags
wind

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile opencpn codes on Windows 7, not use Visual Studio 2010 bailizi OpenCPN 1 18-07-2012 02:40
Can Someone Help Compile on Raspberry Pi ? jimseng OpenCPN 11 06-07-2012 16:24
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


All times are GMT -7. The time now is 13:43.


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.