Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 05-06-2018, 05:26   #1
Registered User

Join Date: Jun 2018
Posts: 68
Windows Compile Help

Hi All, I am new to the forum. I am trying to find a source to get help with compiling OpenCPN for windows. I followed the developers guide but I still have some questions and I could not find a forum devoted to just development. Perhaps somebody can help here. Just FYI, I am a Linux developer so Windows is new for me. First some background...

- I am compiling with VS 2017 Enterprise

- I have installed the perquisites as indicated in the guide including the wxWidgets from source. wxWidgets builds correctly for both release and debug.

- I can build OpenCPN (following the guide) for both build and release with no errors, just warnings.

My questions are as follows:

(1) How does the OpenCPN build use my build of wxWidgets since there seems to already be a pre-compiled set of DLLs in the buildwin folder?

(2) I built the debug version of OpenCPN… so how do I get it to run in the debugger?

(3) If I already have a production install of OpenCPN, should I uninstall it before running the installer for the version I build?

- Thanks in advance!
cryptik is offline   Reply With Quote
Old 05-06-2018, 05:56   #2
Registered User

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

UPDATE: I did actually find an old thread on running the debugger. I was able to set the startup project in VS2017 to opencpn and launch the debugger. My problem now is that it cant find the curl or wxWidgets DLLs. I am assuming I need to manually copy these somewhere to run in debug mode?
cryptik is offline   Reply With Quote
Old 05-06-2018, 05:58   #3
Registered User

Join Date: Oct 2014
Posts: 274
Re: Windows Compile Help

Build instructions for Visual Studio 2017 are here:

https://github.com/nohal/OpenCPN/wik...n-Windows---O5

This builds what should become OpenCPN version 5. However, the current release is OpenCPN 4.8.4 which builds with Visual Studio 2013.


Paul
.Paul. is offline   Reply With Quote
Old 05-06-2018, 06:12   #4
Registered User

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

Thanks Paul. So I am building the master from the OpenCPN git repo. I have everything setup based on the instructions you provided. wxWidgets builds with no issues and OpenCPN builds from both the command line and VS2017.

Now, when I go into VS2017 and set opencpn as the startup project... then run the debugger, it launches... but reports missing dlls (specifically libcurl and wxWidgets).

My confusion now is that I built wxWidgets from source, but did not install it..just ran the nmake command as follows:

nmake /f makefile.vc BUILD=debug SHARED=1 CXXFLAGS=/D_USING_V110_SDK71_ CFLAGS=/D_USING_V110_SDK71_ LDFLAGS=/SUBSYSTEM:WINDOWS",5.01"

How do I tell the opencpn running in my debugger to use my wxwidgets DLLs built from source rather than the ones in buildwin.

Also, how do I tell the debugger to use the other pre-compiled DLLs in buildwin?


Thx in advance, I am certain these are noob questions.
cryptik is offline   Reply With Quote
Old 05-06-2018, 06:18   #5
Registered User

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

Okay... so now I see more info under the VS2013 instructions regarding the buildwin versions of wxWidgets being used for installers, not compile. So I gather if I am building the latest and greatest (i.e. v5), I need to copy the wxWidgets DLLs that I build over to this folder so they are included in the install package?
cryptik is offline   Reply With Quote
Old 05-06-2018, 07:19   #6
Registered User

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

Quote:
Originally Posted by cryptik View Post
Okay... so now I see more info under the VS2013 instructions regarding the buildwin versions of wxWidgets being used for installers, not compile. So I gather if I am building the latest and greatest (i.e. v5), I need to copy the wxWidgets DLLs that I build over to this folder so they are included in the install package?
If you can't launch your executable because of missing dependencies, it means that the OS dynamic library loader does not know where to find them. Several ways to fix it exist - either add their locations to your PATH environment variable or copy them next to opencpn.exe you are launching in the debugger. You also need to copy some data files to your build directory to run in the VS debugger as explained in the instructions.

You don't have to copy anything anywhere to be able to produce the installer package (given you followed the build instructions and have populated the buildwin folder with correct files)
Of course to produce an usable setup package, your opencpn.exe has to be a Release build produced with settings compatible with the libraries provided in the buildwin bundle (which it is if you followed the instructions). Creating the setup package has nothing to do with running in the debugger or ability to do so.
nohal is online now   Reply With Quote
Old 05-06-2018, 07:48   #7
Registered User

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

Thanks all for the replies. I am slowly figuring this out and learning the windows build tools at the same time. In a somewhat related question... If I build a plugin for OpenCPN based on the master code (i.e. 4.99 soon to be 5.0) will those plugins work with the current released version of OpenCPN (4.8.4)?

Conversely, if I go with the current released version of OpenCPN and build my plugin with VS2013 tool chain, will the plugins need to be recompiled to work with the future release of 5.0?

So, lastly, if my goal is to just build a set of plugins for OpenCPN… that I expect to complete in the next month... should I do so using VS2013 and OpenCPN 4.8.4 or build with VS2017 and the latest master code (or does it even matter)?

Thx again
cryptik is offline   Reply With Quote
Old 05-06-2018, 07:56   #8
Registered User

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

Quote:
Originally Posted by cryptik View Post
Thanks all for the replies. I am slowly figuring this out and learning the windows build tools at the same time. In a somewhat related question... If I build a plugin for OpenCPN based on the master code (i.e. 4.99 soon to be 5.0) will those plugins work with the current released version of OpenCPN (4.8.4)?
No.
Quote:
Conversely, if I go with the current released version of OpenCPN and build my plugin with VS2013 tool chain, will the plugins need to be recompiled to work with the future release of 5.0?
No, they will not work and will have to be recompiled.
Quote:
So, lastly, if my goal is to just build a set of plugins for OpenCPN… that I expect to complete in the next month... should I do so using VS2013 and OpenCPN 4.8.4 or build with VS2017 and the latest master code (or does it even matter)?

Thx again
For development it does not matter much (really depends on if and how much you want to use C++11 and features only available in wxWidgets 3.1).
If releasing in a month, O5 will probably still not even be available as a beta release as we are just starting this development cycle and the changes are huge (This is the first time in years when both the above responses are "No") so you have to target O4.8 and the VS2013 based toolchain if general public is your intended audience in this timeframe.
nohal is online now   Reply With Quote
Old 05-06-2018, 09:13   #9
Registered User

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

Thanks for the quick response nohal. The info everybody has provided was a big help. I think, for now, I am going to stick to the VS2013 tool chain, OpenCPN 4.8.4, and its associated dependencies for my plugin development. I can always migrate it later to 5.0 once its released and I have gotten over my learning curve. BTW, OpenCPN is awesome! Great job on that. If I ever get up to speed on this, I will be sure to check in and see if you all can use some additional dev help.
cryptik is offline   Reply With Quote
Old 07-06-2018, 13:01   #10
Registered User

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

Apologies in advance for the noob questions, but I am having a difficult time compiling OpenCPN as the directions seem to be missing steps. I have installed VS2013 and all of the pre-reqs including the precompiled binaries needed to create the the setup package. I have also added the wxwidgets source directory to my path so the compiler finds the new wxwidgets DLLs. I can then build both debug and release .exe files from the command line and from within VS2013 with no errors.

Here is where my problems start. I have copied the precompiled binaries into the buildwin folder as indicated in the build guide, and the files match what is shown in the instructions. I then try and the installer package..following the directions in step 5 of the guide...using this command:

cmake --build . --config release --target package

At this point, I get an error during the package creation indicating that buildwin is missing a number of files including: libssl-1_1.dll, libcrypto-1_1.dll, zlib.dll, curl-ca-bundle.crt. Looking at both the buildwin and _CPack_Packages folders, some of the files don't exist and others are named incorrectly. For example, there are no libssl-1_1.dll, libcrypto-1_1.dll, or curl-ca-bundle.crt files in the buildwin folder. They are also not in the precompiled binaries that were downloaded in step 3. zlib does exist in buildwin but it is named zlib1.dll.

Am I using the wrong version of the precombiled binary file? Again, I am building OpenCPN 4.8.4 with VS Studio 2013 Pro and following the posted build guide. Any help would be most appreciated.


-V/r Cryptik
cryptik is offline   Reply With Quote
Old 07-06-2018, 13:25   #11
Registered User

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

Quote:
Originally Posted by cryptik View Post
Am I using the wrong version of the precombiled binary file?
It is almost certain that the archive you used to populate the buildwin directory is not the right version to be used for OpenCPN 4.8.4. Try https://sourceforge.net/projects/ope....4.7z/download - this one was laying around on my old builder machine so hopefully will be the version we used for 4.8.4.

Pavel
nohal is online now   Reply With Quote
Old 07-06-2018, 14:26   #12
Registered User

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

Thanks Pavel. What I did not think to do was simply look at the dll files installed with the binary installer on the OpenCPN website. I compared those with the new set you sent me... and for the most part... they match. The curl cert file you sent is about two months newer... but the other files match. I am slowly learning

Cheers,
Ken
cryptik is offline   Reply With Quote
Old 07-06-2018, 21:38   #13
Registered User

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

Quote:
Originally Posted by nohal View Post
It is almost certain that the archive you used to populate the buildwin directory is not the right version to be used for OpenCPN 4.8.4. Try https://sourceforge.net/projects/ope....4.7z/download - this one was laying around on my old builder machine so hopefully will be the version we used for 4.8.4.

Pavel
Using your updated precompiled binaries, some tweeks to the online docs, and a batch script of my own, I was finally able to get v4.8.4 to build as debug and run inside VS2013. I am also able to build a release version and install package. I have one remaining issue that I am trying to resolve. When I build a release version and install package, all of the built-in plugins work. When I build a debug version and run it in VS2013, three of the four plugins work except for the chart loader. I have copied the dll and data folder for this plugin just like I do for the other three...but it just does appear in the installed list. I am not sure what to check to see why it won't load. Any advice on this?


V/r
Ken
cryptik is offline   Reply With Quote
Old 08-06-2018, 04:23   #14
Registered User

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

Quote:
Originally Posted by cryptik View Post
Using your updated precompiled binaries, some tweeks to the online docs, and a batch script of my own, I was finally able to get v4.8.4 to build as debug and run inside VS2013. I am also able to build a release version and install package. I have one remaining issue that I am trying to resolve. When I build a release version and install package, all of the built-in plugins work. When I build a debug version and run it in VS2013, three of the four plugins work except for the chart loader. I have copied the dll and data folder for this plugin just like I do for the other three...but it just does appear in the installed list. I am not sure what to check to see why it won't load. Any advice on this?


V/r
Ken
There probably will be something in the logfile. If not enough info there, you may use the debugger you now have working. Or if you are not going to work on the chart downloader itself, you may decide to ignore the fact you don't have it working in the debug mode.

Pavel
nohal is online now   Reply With Quote
Old 08-06-2018, 07:19   #15
Registered User

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

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

UDATE: I found the log files...looking at them now.
cryptik 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 20: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.