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 15-02-2017, 15:53   #511
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

One thing i have noticed is that under weatherfax_pi in the Solution Explorer there is only a folder "Source Files" containing all the .cpp files. There is no folder "Header Files" as under the other plugins.

There are no .h files in the CMakeLists.txt for the weatherfax_pi.
On all other plugins the .h files are listed.

Is this correct ?
What do you have Håkan ?

/Hans
hasse_A is offline   Reply With Quote
Old 16-02-2017, 03:29   #512
Registered User

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

Hans
Now I've tried to build weatherfax inside OCPN - No luck at all!
The same errors as yours I suppose, see below.
I agree that CMakeList.txt are missing all headers but it make no difference if I add all "*.h ", the same error although the "header" folder now shows up in VS2013 solution explorer.
I've built many plugins in the same way w/o problem. What's missing for weatherfax I don't now. It's beyond my knowledge.
Anyone else???
First portion of my errors list:
Code:
c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(35): error C2146: syntax error : missing ';' before identifier 'read'
8>c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(35): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
8>c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(35): warning C4183: 'read': missing return type; assumed to be a member function returning 'int'
8>c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(36): error C2146: syntax error : missing ';' before identifier 'write'
8>c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(36): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
8>c:\builds\ocpn\opencpn\plugins\weatherfax_pi\src\libaudiofile\modules\FileModule.h(36): warning C4183: 'write': missing return type; assumed to be a member function returning 'int'
8>C:\Builds\OCPN\OpenCPN\plugins\weatherfax_pi\src\libaudiofile\File.h(60): error C2146: syntax error : missing ';' before identifier 'read'
Hakan is offline   Reply With Quote
Old 16-02-2017, 03:51   #513
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 a lot Håkan.!

Funny enough, I did exactly the same thing, added all the header files to
CmakeLists.txt and the Header files turned up under weatherfax_pi in the Solution Explorer.
But I also get my 259 errors building Release and 271 for Debug.

There is a dog buried here somewhere as we say in Sweden.

I am pretty sure the resolution is simple but as for you Håkan this is over my head.

/Hans
hasse_A is offline   Reply With Quote
Old 16-02-2017, 09:08   #514
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

The first error points to this line in src\libaudiofile\modules\FileModule.h :

ssize_t read(void *data, size_t nbytes);

error C2146: syntax error : missing ';' before identifier 'read'

I presume this points to the type ssize_t.
ssize_t is not a predefined type i think.

This type is declared to an int in src\libaudiofile\config.h

typedef int ssize_t;

Now, I can't see that config.h is included in FileModule.h or any file included herein.

Should it not be ?

If pointing to ssize_t in FileModule.h in VS 2013 it shows that ssize_t is :
typedef wxInt32 ssize_t

/Hans
hasse_A is offline   Reply With Quote
Old 16-02-2017, 09:54   #515
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

Latest news : There seems to be a problem with the configuration in some way.

There is a file named Track.h under weatherfax_pi\src\libaudiofile.

But, there is also a file with the same name under OpenCPN\include

It is this later file that is pointed to in the error window and the
error message points to a line in this file even though the project is said to be weatherfax_pi.
This can explain why the plugin can be compiled alone as there is then no conflicting file present.

I am sorry but I do not know how to resolve this.
I assume this needs to be taken care of in a configuration file of some sort.
CmakeLists.txt ?

One other way would be to change the name of the file but this seems to be a less elegant way and a doubt that is the way a "real programmer" would do it.

/Hans
hasse_A is offline   Reply With Quote
Old 16-02-2017, 11:56   #516
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

I've git fetched, pulled and compiled v4.5.214 and compiled for release and installed it and it seems to work fine. However I cannot seem to get this to cmake --build . --config debug to work under Debug > Start Debug. All modules compile successfully however.

See http://www.cruisersforum.com/forums/...ml#post2327204

I'd like to get this version working in Debug, so I can try to help Hasse_A too with debug of weatherfax.
rgleason is offline   Reply With Quote
Old 16-02-2017, 13:58   #517
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

Rick!

You are correct. I can't get latest working.
It compiles ok but refuses to debug.

/Hans
hasse_A is offline   Reply With Quote
Old 16-02-2017, 15:43   #518
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 downloaded 4.4.0 and tried to build it.
I get a peculiar error for both Release and Debug.

Error 14 error C3861: 'min': identifier not found C:\Users\hasse\OCPN\OpenCPN\src\routeprop.cpp 2816 1 opencpn

SetMinSize(wxSize(-1, min(600, wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ))));

Looks like function min() is not declared.
I have no clue where that should have been done.

/Hans
hasse_A is offline   Reply With Quote
Old 17-02-2017, 11:39   #519
Registered User
 
transmitterdan's Avatar

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

I checked out version 4.4.0 from the git repository. It builds without error in both release and debug mode. I am using VS 2015 even though that isn't officially recognized as a supported build platform. I also built it against wx V 3.1 (latest official release) without errors too.
transmitterdan is offline   Reply With Quote
Old 17-02-2017, 23:28   #520
Registered User

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

Hans - Good trace.
re: "There is a file named Track.h under weatherfax_pi\src\libaudiofile."
I've unloaded weatherfax from my repo but two things you could try?
1)
edit all #include "Track.h" in project weatherfax to something like
#include "plugins\\weatherfax_pi\\src\\libaudiofile\\Track. h"
or as you say:
2) Rename all references to, and the file itself to something else: wTrack.h ?
Obviously is Sean's Track.h no longer equal to OCPN's Track.h
Håkan
Hakan is offline   Reply With Quote
Old 18-02-2017, 06:25   #521
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

Started from scratch again.

Did : git clone git://github.com/OpenCPN/OpenCPN.git
Loaded the binary dependencies to buildwin.

Configured under build.
Compiled Release and Debug.

Copied the appropriate files to build\Release and build\Debug

Started VS 2013 and set opencpn.sln to Startup Project
Compiled the project again for debug in VS 2013.

No problem up to this point.

Tried to start Debug and I get assertion Fail.
Se attachments.

Note, this is only OpenCPN without any plugins.
Should I reinstall VS 2013 ?

/Hans
Attached Thumbnails
Click image for larger version

Name:	Assertion Fail.jpg
Views:	85
Size:	48.7 KB
ID:	141499   Click image for larger version

Name:	Asserion Fail2.jpg
Views:	71
Size:	390.1 KB
ID:	141500  

hasse_A is offline   Reply With Quote
Old 18-02-2017, 12:48   #522
Registered User

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

Hans
I get the same brake in debug mode here:
in stringops.h row: 40
Code:
 // moves the iterator by n Unicode characters
    template <typename Iterator>
    static Iterator AddToIter(const Iterator& i, ptrdiff_t n)
>>        { return i + n; }
i = "L" and n = 2

call stack:
Code:
>     msvcp120d.dll!54f5cee6()    Unknown
     [Frames below may be incorrect and/or missing, no symbols loaded for msvcp120d.dll]    
     [External Code]    

>    wxbase30ud_vc_custom.dll!wxStringOperationsWchar::AddToIter<std::_String_iterator<std::_String_val<std::_Simple_types<wchar_t> > > >(const std::_String_iterator<std::_String_val<std::_Simple_types<wchar_t> > > & i, int n) Line 40    C++
     wxbase30ud_vc_custom.dll!wxString::iterator::operator+(int n) Line 1038    C++
     wxbase30ud_vc_custom.dll!wxString::GetIterForNthChar(unsigned int n) Line 1090    C++
     wxbase30ud_vc_custom.dll!wxString::at(unsigned int n) Line 1519    C++
     wxbase30ud_vc_custom.dll!wxString::operator[](int n) Line 1557    C++
     opencpn.exe!s57chart::IsCellOverlayType(char * pFullPath) Line 3275    C++
     opencpn.exe!Quilt::Compose(const ViewPort & vp_in) Line 1818    C++
     opencpn.exe!ChartCanvas::SetViewPoint(double lat, double lon, double scale_ppm, double skew, double rotation, int projection, bool b_adjust, bool b_refresh) Line 3372    C++
     opencpn.exe!MyFrame::DoChartUpdate() Line 8149    C++
     opencpn.exe!MyApp::OnInit() Line 2332    C++
     wxbase30ud_vc_custom.dll!wxAppConsoleBase::CallOnInit() Line 93    C++
     wxbase30ud_vc_custom.dll!wxEntryReal(int & argc, wchar_t * * argv) Line 479    C++
     wxbase30ud_vc_custom.dll!wxEntry(int & argc, wchar_t * * argv) Line 188    C++
     wxmsw30ud_core_vc_custom.dll!wxEntry(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * __formal, int nCmdShow) Line 415    C++
     opencpn.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 872    C++
     [External Code]
msvcp120d.dll is present so it's something else.
Håkan
Hakan is offline   Reply With Quote
Old 18-02-2017, 13:28   #523
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

See http://www.cruisersforum.com/forums/...ml#post2327204

Same results. Hakan thanks for spelling it out in detail.
rgleason is offline   Reply With Quote
Old 18-02-2017, 18:06   #524
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

I think it might have something to do with reading the current chart. Perhaps something has changed relative to that. No chart appears before the assert.
rgleason is offline   Reply With Quote
Old 18-02-2017, 20:11   #525
Marine Service Provider
 
bdbcat's Avatar

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

Rick/Hakan...

I never really saw the assert in live action. But the trouble and solution is clear.

In the assert location, we are looking at the third character of a filename. If the filename is empty, or very short, then the third character does not exist. wxWidgets warns us of that with an assert.

Fix is simple, and I have committed a patch to github.

Let me know if this helps.

Dave
bdbcat 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 15:33.


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.