Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 03-03-2017, 05:51   #1
Registered User

Join Date: May 2012
Posts: 863
Compiling OpenCPN for Windows

One example of a workflow for compiling OpenCPN on a Windows machine, using Visual Studio Community 2013 (Visual Studio 12!), is now available.

It is the first draft and may need some editing.

https://opencpn.org/wiki/dokuwiki/do...teps_-_example

Note: This morning VS Community 2013 was not available from Microsoft. VS Studio Express 2013 was still on the Microsoft website and this can be used instead of Community. Is Community 2013 being pulled?

Mike
Rasbats is offline   Reply With Quote
Old 03-03-2017, 05:53   #2
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 14,431
Re: Compiling OpenCPN for Windows

Maybe we should be moving to 2015 since TDan is using it? He was going to give someone some tips about using it for Opencpn compiling.


Of course now that the documentation has been updated and new resources added.

Pavel? Bdbcat? What do you think?
rgleason is offline   Reply With Quote
Old 03-03-2017, 06:55   #3
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 2,960
Re: Compiling OpenCPN for Windows

Mike
Very nice indeed!
I haven't read all details but I happened to see two things to add:
At label: Build OpenCPN
I think it's important to select opencpn in Solution Explorer and "Set as StartUp Project"

And I may have missed it but it could be important to set also VS2013 to use "LF" and not "CR LF" and four spaces instead of tab.

Håkan
Hakan is offline   Reply With Quote
Old 03-03-2017, 07:09   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 2,960
Re: Compiling OpenCPN for Windows

Mike..
One more thing:
For me the VS2013 Package project use to create the opencpn_4.xx_setup.exe in .....\opencpn\build\ as of your build output example not in the \NSIS\......??
Håkan
Attached Thumbnails
Click image for larger version

Name:	package.PNG
Views:	63
Size:	23.8 KB
ID:	142350  
Hakan is offline   Reply With Quote
Old 03-03-2017, 07:40   #5
Registered User

Join Date: May 2012
Posts: 863
Re: Compiling OpenCPN for Windows

Håkan,

Thanks. You are correct. The 'setup.exe' is built in both places. Probably better to tell people to look in 'build'.

I have now changed this.

I have been working with a clean hard drive and 'Set as Startup Project' was not needed. However, just in case, I have added this step.

'LF', 'CR LF' options did not need touching. I cannot find the way to change this with Community 2013!

Intention is to make things as simple as possible. If someone uses this guide and encounters a problem I can add extra steps.

Now to see what happens with Community 2015!

Mike
Rasbats is offline   Reply With Quote
Old 03-03-2017, 08:03   #6
Registered User

Join Date: May 2012
Posts: 863
Re: Compiling OpenCPN for Windows

Community 2013 is back!

Mike
Rasbats is offline   Reply With Quote
Old 03-03-2017, 08:18   #7
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 14,431
Re: Compiling OpenCPN for Windows

I like Mike's page because it has visuals. There are now two pages about this

Compiling Windows step by step main page, with the batch files
https://opencpn.org/wiki/dokuwiki/do...piling_windows

Mike's more visual Compiling Example Workflow
https://opencpn.org/wiki/dokuwiki/do...teps_-_example



Step by step page has the batch files.
rgleason is offline   Reply With Quote
Old 03-03-2017, 08:24   #8
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 14,431
Re: Compiling OpenCPN for Windows

Mike, if you are going to do MS VS 2015 Community, perhaps you want to consider a completely separate namespace similar to VS 2013?

Because we will inevitably move forward at some point and it will save time to have two separate docs and will help users. (Based on your experience it may be a simple difference, but inevitably some things change....

Directly under Compiling Windows...

Compiling Windows
- Example Workflow VS2013
- Example Workflow VS2015
rgleason is offline   Reply With Quote
Old 03-03-2017, 09:19   #9
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 2,960
Re: Compiling OpenCPN for Windows

Quote:
Originally Posted by Rasbats View Post
Håkan,

Thanks. You are correct. The 'setup.exe' is built in both places. Probably better to tell people to look in 'build'.
Thanks for the lesson! Have never seen the NSIS\ one. The difference is that \NISI\ is renewed for every build. In \build are old versions still left until deleted.
Quote:
I have been working with a clean hard drive and 'Set as Startup Project' was not needed. However, just in case, I have added this step.
If I'm correct it's needed once you build another plugin inside OCPN.
Quote:
'LF', 'CR LF' options did not need touching. I cannot find the way to change this with Community 2013!
Mike
OK, very good. I may these are set from Git first time VS2013 is used.

Thanks
Håkan
Hakan is offline   Reply With Quote
Old 03-03-2017, 09:36   #10
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 6,178
Re: Compiling OpenCPN for Windows

Hakan/Mike...

re:
'LF', 'CR LF' options did not need touching. I cannot find the way to change this with Community 2013!

We need to be very sure that these options are correct in the instructions.
I do not like to accept pull requests with bad CR/LF and tabs. It contaminates the source code, makes it hard to read and edit. Takes a bit of effort to reformat a file afterwards...

Thanks
Dave
bdbcat is offline   Reply With Quote
Old 03-03-2017, 14:50   #11
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 14,431
Re: Compiling OpenCPN for Windows

Pavel's main page for Compiling Windows addresses LF CR/LF issues and is quite specific!

I think rhat should be read or referenced.
rgleason is offline   Reply With Quote
Old 04-03-2017, 02:19   #12
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 2,960
Re: Compiling OpenCPN for Windows

Mike..
If you like I've a picture for tab settings in VS2013.
Use: Tools > Options > see picture....

The line endings is more tricky. The only official way is to set export option to each ducument. But default setting seems to be "leave as is" meaning Git is the master. But it could be worth mention that every line ending in all code must use "UNIX LF", and every notice/question from VS about line endings should be answered with set to "UNIX LF". This can occur once you copy text from i.g. Notepad and have forgotten to set Notepad++ to "UNIX LF".
Not: VS2013 does inform and ask user about actions, if set, but only at a file opening event.
Pls advice if you want better picture copies uploaded anywhere.
Håkan
Attached Thumbnails
Click image for larger version

Name:	VS2013_tabs.PNG
Views:	63
Size:	14.8 KB
ID:	142408   Click image for larger version

Name:	VS_LineEnd.PNG
Views:	81
Size:	24.5 KB
ID:	142409  

Click image for larger version

Name:	VS_Inconsist_LineEnd.PNG
Views:	66
Size:	7.0 KB
ID:	142410  
Hakan is offline   Reply With Quote
Old 04-03-2017, 03:48   #13
Registered User

Join Date: May 2012
Posts: 863
Re: Compiling OpenCPN for Windows

I am struggling with Community 2015 at the moment. Perhaps transmitterdan can give me some pointers when he has time.

When Community 2013 is reinstalled the settings will be investigated and the wiki worked on. Hakan ... thanks, these images will be useful. On Community 2015 these settings are the default for a new installation.

Rick ... the issue of Unix LF line endings in "Compiling Windows" was in the Git section. The wiki workflow covered that, I hope.

Mike
Rasbats is offline   Reply With Quote
Old 04-03-2017, 05:28   #14
Registered User

Join Date: May 2012
Posts: 863
Re: Compiling OpenCPN for Windows

Tabs and line endings now added to the wiki. Hakan's images did the job.

Mike
Rasbats is offline   Reply With Quote
Old 04-03-2017, 05:34   #15
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 5,228
Re: Compiling OpenCPN for Windows

Guys...
Is there something wrong with letting Git handle the Windows CR/LF mess on Windows as we always did and is described in https://opencpn.org/wiki/dokuwiki/do...piling_windows (Paragraph 1.2)
It is completely editor/IDE agnostic and actually works...

Pavel
nohal is offline   Reply With Quote
Reply

Tags
enc, opencpn, 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
OpenCPN Compiling in windows using visual studio page not found dinusha OpenCPN 7 25-09-2016 16:17
Linux cross compiling for windows failing jongough OpenCPN 42 29-11-2014 20:09
Compiling OpenCPN Windows 8.1 Ptizef OpenCPN 4 22-07-2014 13:08
Compiling & Debug in Windows MSVC rgleason OpenCPN 1 04-07-2014 17:42
Compiling OpenCPN in Windows useris OpenCPN 20 29-06-2013 07:45

Advertise Here


All times are GMT -7. The time now is 01:30.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.