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 22-08-2017, 13:57   #1
Registered User

Join Date: Aug 2017
Posts: 10
Problem compiling Navico Radar plugin beta 3.816 in Windows

Hi, everyone.

I am having trouble compiling Navico Radar plugin beta 3.816 under Windows and using it after compilation.

I use:
- Windows 10 Pro 64 bits V. 1703 Build 15063.540
- MS Visual Studio Community 2013 V. 12.0.40629.00 Update 5
- OpenCPN 4.8.0
- wxWidgets 3.0.3
- cmake 3.9.0

I was able to compile OpenCPN 4.8.0 in VS with a few dozen warnings but without any error. After that, I was able to run it inside VS in debug mode without a glitch!

I have used the opencpn.lib I created when compiling OpenCPN 4.8.0 to compile the radar plugin standalone (not inside the OpenCPN solution), inside VS, without any warnings and without errors.

However, if I put the radar dll that was created in the OpenCPN plugin folder, it does not work...

If I use the radar dll with the OpenCPN 4.8.0 that I complied myself, running it in debug mode inside VS, I get an
Quote:
Unhandled exception at 0x5CDDB1F4 (br24radar_pi.dll) in opencpn.exe: 0xC0000005: Access violation reading location 0xCDCDCDCD.


I have also tried to install OpenCPN 4.8.0 using the installer I downloaded from http://opencpn.navnux.org/4.8.0/opencpn_4.8.0_setup.exe.

If I put my radar dll inside the installed OpenCPN 4.8.0 plugin folder, I get a warning message that says
Quote:
Unknown image data format
and a "wxWidgets Debug Alert" window that says that function image.IsOk() in line 922 of the wxWidgets file bitmap.cpp returned false...



Can someone help me? Perhaps someone from the developers of the radar plugin...

Thank you!!!!!
eduardopeloso is offline   Reply With Quote
Old 22-08-2017, 16:19   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Problem compiling Navico Radar plugin beta 3.816 in Windows

As far as I can see, you have no problem compiling.

0xCDCDCDCD is a magic number VS fills to new pointer variables in Debug mode to help with debugging unitialised variable related problems and it is not NULL. The crash you get seems to be caused by m_timer not being initialised. And it is probably not initialised because m_radar was not 0 in https://github.com/canboat/BR24radar...rInfo.cpp#L222
Why it was not 0 I don't know, but you should be able to see it.

When putting your br24radar_pi DLL to the plugins folder in the installed OpenCPN you downloaded, you are mixing debug and release build products, that is an obvious no go. You must build a release version linked to the release version of wxWidgets libs and then it should work, the WX asserts are turned off in release builds of the libraries. Don't forget about the data files from https://github.com/canboat/BR24radar...ee/master/data
nohal is online now   Reply With Quote
Old 23-08-2017, 09:19   #3
Registered User

Join Date: Aug 2017
Posts: 10
Re: Problem compiling Navico Radar plugin beta 3.816 in Windows

Thank you, nohal!

I understand your comments.

Well, there is a RadarInfo constructor like this:
RadarInfo::RadarInfo(br24radar_pi *pi, int radar)

and inside it there is the following line:
m_radar = radar;

So it sets m_radar to the value of radar

Well, in file br24radar_pi.cpp 2 instances of RadarInfo are created, in lines 225 and 226:

m_radar[0] = new RadarInfo(this, 0);
m_radar[1] = new RadarInfo(this, 1);

The second RadarInfo has m_radar not 0...

So it looks like it is "normal" to have an m_radar not 0...

My problem is: when I download the plugin installer and use it, the plugin works just fine! This tells me that the code is OK, and needs no debugging...

Then, if I download the plugin source code and compile it, it should works just as well! Don´t you think?

Is it not the case that I need is to understand why the dll compiled by me is not working, and what I should do to make it work?
eduardopeloso is offline   Reply With Quote
Old 23-08-2017, 09:26   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Problem compiling Navico Radar plugin beta 3.816 in Windows

The DLL compiled by you is likely not working because it is compiled in Debug mode. Yes, it probably is quite normal to have m_radar != 0, otherwise it would not be there.

To fix the crash you get, add
Code:
m_timer=NULL;
at https://github.com/canboat/BR24radar...rInfo.cpp#L197
Which of course does not mean you wont get another crash somewhere else for the same uninitialized variable reason when running in Debug mode.
nohal is online now   Reply With Quote
Reply

Tags
navico, plug, radar, wind


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
Navico Radar Plugin + heading problem Jonna OpenCPN 17 15-02-2018 23:54
Navico Radar plugin beta 3.816 released merrimac OpenCPN 21 09-09-2017 03:26
Problem compiling Navico Radar plugin beta 3.816 in Windows eduardopeloso OpenCPN 1 22-08-2017 18:20
Navico radar plugin hardware connection mikereed100 OpenCPN 8 07-12-2015 09:44
Windows 4 stable and Windows Beta svzephyr44 OpenCPN 0 29-09-2015 10:46

Advertise Here


All times are GMT -7. The time now is 12:56.


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.