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 11-05-2020, 02:26   #631
Registered User
 
transmitterdan's Avatar

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

Quote:
Originally Posted by rgleason View Post
It builds release and debug versions from the command line without errors.
So it must be something I am not doing properly in MS Visual Studio.

Rick,

Impossible to build from inside Visual Studio as of now. Always build from command line and debug from VS should work. But it appears you are no longer using the scripts I wrote so hard to tell exactly what you are trying to do.
transmitterdan is offline   Reply With Quote
Old 12-05-2020, 04:27   #632
Registered User
 
rgleason's Avatar

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

TDan. Thanks, that's helpful. I had to upgrade to wxWidgets 3.1.2 a little while ago, so I lost the BATCH setup. I will implement that next.
rgleason is offline   Reply With Quote
Old 24-08-2020, 03:02   #633
Registered User

Join Date: Oct 2011
Location: Apeldoorn
Boat: Ovni 385
Posts: 339
Re: Development Debugging Environment - Setup Help

Error compiling, and solution!

After doing a fresh Windows 10 install on a new computer, I installed the OpenCPN development environment, strictly following the instructions, I know it will work immediately then.

But on the command:

cmake --build . --config release I had the following error, after compiling the sources:
C:\Users\Douwe : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. [C:\opencpn\OpenCPN\build\opencpn.vcxproj]
This really puzzled me, the opencpn.vcxproj file is there and all permissions are set.

Searching with Microsoft, the problem seems to be that there is a space in the filename. But in this case there is no space. And still there is a space, it is in the username that Microsoft requires when installing windows. Microsoft asks for your name and makes that the username for the login. Solution: make a new username with a new Microsoft account. Making a new local username will not work (I tried, but the account is still linked to the original name). So this requires a new email address and new Microsoft account. Alternatively you have to reinstall windows. This problem is known in Microsoft for years, they don't do anything with it and they allow spaces in usernames.

May be mention this in the installation manual, Windows username should not have a space in it.
Douwe Fokkema
Douwe Fokkema is offline   Reply With Quote
Old 24-08-2020, 03:25   #634
Registered User

Join Date: Oct 2011
Location: Apeldoorn
Boat: Ovni 385
Posts: 339
Re: Development Debugging Environment - Setup Help

Another point of interest, compile time.

On my previous I7 based machine time for a full compile of OpenCPN was around 10 minutes. With the new AMD Ryzen 5 3600, this was down to about 5 minutes. Should be faster, not all cores were being used.

Changing following line in the CMakeCache.txt does the job:
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MP
Here I have added the /MP flag.
Now 11 of the 12 processor threads are fully loaded during a compile, compile time (full compile) is down to 1 minute 35 sec.

But in the fresh Windows installation, this flag is of less importance, without flag 2.5 minute, with /MP 1 min 35 sec.

Douwe Fokkema
Douwe Fokkema is offline   Reply With Quote
Old 09-09-2020, 11:47   #635
Registered User
 
hasse_A's Avatar

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

I am setting up a new environment on windows 10 machine.
Configuration:
VS2017
wxWidgets 3.1.2
I am using Transmitter Dan's batchutils.
Making a release and installing that runs fine.
If l I try to do debugging in VS. I get a trap in wxWidget file appbase.cpp:1163 Red line.


// default assert handler
static void
wxDefaultAssertHandler(const wxString& file,
int line,
const wxString& func,
const wxString& cond,
const wxString& msg)
{
// If this option is set, we should abort immediately when assert happens.
if ( wxSystemOptions::GetOptionInt("exit-on-assert") )
wxAbort();

// FIXME MT-unsafe
static int s_bInAssert = 0;

wxRecursionGuard guard(s_bInAssert);
if ( guard.IsInside() )
{
// can't use assert here to avoid infinite loops, so just trap
wxTrap();

return;
}


If I ignore and do continue I will get a new error in object.cpp:353 Red line
"unable to read data"

void wxObject::Ref(const wxObject& clone)
{
// nothing to be done
if (m_refData == clone.m_refData)
return;

// delete reference to old data
UnRef();

// reference new data
if ( clone.m_refData )
{
m_refData = clone.m_refData;
m_refData->IncRef();
}
}

/Hans
hasse_A is offline   Reply With Quote
Old 09-09-2020, 13:59   #636
Registered User
 
transmitterdan's Avatar

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

Quote:
Originally Posted by hasse_A View Post
I am setting up a new environment on windows 10 machine.
Configuration:
VS2017
wxWidgets 3.1.2
I am using Transmitter Dan's batchutils.
Making a release and installing that runs fine.
If l I try to do debugging in VS. I get a trap in wxWidget file appbase.cpp:1163 Red line.


// default assert handler
static void
wxDefaultAssertHandler(const wxString& file,
int line,
const wxString& func,
const wxString& cond,
const wxString& msg)
{
// If this option is set, we should abort immediately when assert happens.
if ( wxSystemOptions::GetOptionInt("exit-on-assert") )
wxAbort();

// FIXME MT-unsafe
static int s_bInAssert = 0;

wxRecursionGuard guard(s_bInAssert);
if ( guard.IsInside() )
{
// can't use assert here to avoid infinite loops, so just trap
wxTrap();

return;
}


If I ignore and do continue I will get a new error in object.cpp:353 Red line
"unable to read data"

void wxObject::Ref(const wxObject& clone)
{
// nothing to be done
if (m_refData == clone.m_refData)
return;

// delete reference to old data
UnRef();

// reference new data
if ( clone.m_refData )
{
m_refData = clone.m_refData;
m_refData->IncRef();
}
}

/Hans

Hans,

Look at the call stack to see what in O is making this call. The problem is likely not within wxWidgets.
transmitterdan is offline   Reply With Quote
Old 10-09-2020, 02:17   #637
Registered User
 
hasse_A's Avatar

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

Thanks Dan!

There is a call from chcanv.cpp: 4354

*r = wxPoint(wxRound(p.m_x), wxRound(p.m_y));

where the values of p seems to be suspicious. Right ?
Attached Thumbnails
Click image for larger version

Name:	Ocpn_1.jpg
Views:	56
Size:	436.4 KB
ID:	223115  
hasse_A is offline   Reply With Quote
Old 10-09-2020, 06:21   #638
Registered User
 
transmitterdan's Avatar

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

Quote:
Originally Posted by hasse_A View Post
Thanks Dan!

There is a call from chcanv.cpp: 4354

*r = wxPoint(wxRound(p.m_x), wxRound(p.m_y));

where the values of p seems to be suspicious. Right ?

Yes, it looks to be an uninitialized value. Now, the challenge is to find out why.

When debugging in Windows it is always a challenge to be sure all the data files are correctly copied into the debug directory tree. With the batch_utils this is done by the config.bat process. Be sure you have the latest batch_utils by doing git pull. The in the O build folder run config.bat and dbbuild.bat. Then start OpenCPN.sln. Don’t try to build inside the Visual Studio IDE. Always use dbbuild.bat.
transmitterdan is offline   Reply With Quote
Old 10-09-2020, 07:24   #639
Registered User
 
hasse_A's Avatar

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

C:\Users\hasse\Sources\BatchUTILS>git pull
Already up to date.

After dbbuild I get the same result with Trap.....

I then did a clean, git pull in the OpenCPN-dir

C:\Users\hasse\Sources\BatchUTILS>git pull
Already up to date.

Did config, dbbuild.bat, started VS and then got the same result.

Should I traverse the call stack upwards to try to find out if p is
set somewhere ?

/Hans
hasse_A is offline   Reply With Quote
Old 10-09-2020, 08:36   #640
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,463
Re: Development Debugging Environment - Setup Help

Hans...


"p" is set immediately above, at line 4345.
Check the parameters to the GetDoubleCanvasPixPointVP() call.



Dave
bdbcat is offline   Reply With Quote
Old 10-09-2020, 09:27   #641
Registered User
 
transmitterdan's Avatar

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

Quote:
Originally Posted by hasse_A View Post
C:\Users\hasse\Sources\BatchUTILS>git pull
Already up to date.

After dbbuild I get the same result with Trap.....

I then did a clean, git pull in the OpenCPN-dir

C:\Users\hasse\Sources\BatchUTILS>git pull
Already up to date.

Did config, dbbuild.bat, started VS and then got the same result.

Should I traverse the call stack upwards to try to find out if p is
set somewhere ?

/Hans

Hans, be sure batch_utils is up to date via git pull in the batch_utils folder.
transmitterdan is offline   Reply With Quote
Old 10-09-2020, 10:52   #642
Registered User
 
hasse_A's Avatar

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

Quote:
Originally Posted by transmitterdan View Post
Hans, be sure batch_utils is up to date via git pull in the batch_utils folder.
I did this and got "Already up to date."
C:\Users\hasse\Sources\BatchUTILS>git pull
Already up to date.

/Hans
hasse_A is offline   Reply With Quote
Old 10-09-2020, 11:12   #643
Registered User
 
hasse_A's Avatar

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

Quote:
Originally Posted by bdbcat View Post
Hans...
"p" is set immediately above, at line 4345.
Check the parameters to the GetDoubleCanvasPixPointVP() call
Dave
Dave,

I attached 2 pictures.
1) values from variables at line 4345
2) values of variables in: void ChartCanvas::ScaleBarDraw( ocpnDC& dc )
which seem to be executed before where the Trap occurs.
The variable m_canvas_height seem to have a large negative value.

/Hans
Attached Thumbnails
Click image for larger version

Name:	Ocpn_2.jpg
Views:	49
Size:	440.3 KB
ID:	223143   Click image for larger version

Name:	Ocpn_3.jpg
Views:	43
Size:	431.3 KB
ID:	223144  

hasse_A is offline   Reply With Quote
Old 11-09-2020, 09:18   #644
Registered User
 
hasse_A's Avatar

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

I can't find the place where "m_canvas_height" is set.

A bit surprising is that the value is changed from 998032515 to -842150451
between the breakpoints in the 2 pictures attached.
I can't see any code that is able to do that here.

Only place I can see that the m_canvas_height could be altered is in
chcanv.cpp:6558 GetClientSize( &m_canvas_width, &m_canvas_height );
but that line is never executed before the trap occurred and I am not able to find the function :GetClientSize() anywhere in the src tree.
Attached Thumbnails
Click image for larger version

Name:	Ocpn_4.jpg
Views:	41
Size:	424.3 KB
ID:	223208   Click image for larger version

Name:	Ocpn_5.jpg
Views:	46
Size:	426.6 KB
ID:	223209  

hasse_A is offline   Reply With Quote
Old 11-09-2020, 09:38   #645
Registered User
 
transmitterdan's Avatar

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

In Visual Studio you can right click on a function name and then find the source code via that popup menu. You can open the declaration or the implementation of the function.
transmitterdan 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 19:29.


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.