Cruisers Forum
 


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 06-08-2015, 18:26   #16
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN Development

David...
I need to see that "load of errors" to try to understand what's going on... Are you sure that you built the installer from a Release build? Why don't you simply run from Visual Studio and see what's wrong?

Pavel
nohal is offline   Reply With Quote
Old 06-08-2015, 18:45   #17
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: OpenCPN Development

David,

A lot of flailing around with different code bases and build environments. What I recommend is that you set up a virtual machine for building O. I use Linux because the build environment is so much simpler than Windows.

Windows VS2012 is also ok as a development environment. Get rid of all the old V4.0 code base and get fresh from GIT the latest sources. Before you start trying to build plugins get V4.1.178 (or whatever the latest is) building and installing. It builds 2 plugins as part of the default build. Then learn how to put plugin source trees within the O tree. For most of the mainline plugins the standard O build process will build the plugins and add them to the install package.

Next, get your windows build environment configured so you can debug plugins. For that you have to put certain files in certain places within the OpenCPN\build tree. The web site instructions explain this. The instructions are precise but brief. Read them carefully and follow exactly. You will know you have it right when you can set a breakpoint in a plugin and see the breakpoint become "active" when the DLL loads.

Once you can debug O and known good plugins in Windows then you are ready to launch into your own plugin development. Learn how to create your own plugin cmake configuration so that the standard O build process will build and add your plugin to the installation. This is not a one day learning process. For a good developer it can take a few days studying the whole setup and learning how it is supposed to work. Don't try to force the O development process to fit what you think it should be. You will be frustrated for a long time. So learn how it works and follow it along.
transmitterdan is offline   Reply With Quote
Old 07-08-2015, 04:21   #18
Registered User

Join Date: Aug 2015
Posts: 17
Re: OpenCPN Development

Thanks lads so far - I finally have a build environment that works.

I decided to use the GUI's in cmake and VS instead. As predicted in cmake, the wxWidgets_LIV_DIR was set to vc_lib instead of vc_dll.
I also noticed in VS2013 that the toolset property of each project was not set to v120_xp so I changed it (does that make a difference?).
Now I 'll get the debugger going.
Any other hints and caveats any of you can come up with would be really appreciated.

Thanks again.

David
Cags is offline   Reply With Quote
Old 07-08-2015, 06:19   #19
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN Development

Quote:
Originally Posted by Cags View Post
Thanks lads so far - I finally have a build environment that works.

I decided to use the GUI's in cmake and VS instead. As predicted in cmake, the wxWidgets_LIV_DIR was set to vc_lib instead of vc_dll.
Interesting, there is no "vc_lib" folder in the wxWidgets tree on any of my windows machines. It would probably be there if I did produce a static wxWidgets build instead of the DLL one we need for OpenCPN. Anyway, the $WXDIR/lib/vc_dll location is correct. If you were until now linking against the static wxWidgets, you might have a root cause of the problem.
Quote:
I also noticed in VS2013 that the toolset property of each project was not set to v120_xp so I changed it (does that make a difference?).
Hard to say not knowing which projects you are talking about. On my machine all of them are consistently set to what I tell cmake to set them to. You sure don't want a mix of v120 and v120_xp. To be compatible with the official builds, you must use v120_xp. For your local builds it does not matter which you use (v120_xp means the final linked binary will be usable on Windows XP), the important part is the consistency. In theory the projects not producing binaries (like i18n and packaging) could be set to whatever, I think.

Pavel
nohal is offline   Reply With Quote
Old 07-08-2015, 06:56   #20
Registered User

Join Date: Aug 2015
Posts: 17
Re: OpenCPN Development

Pavel,

When I opened build\opencpn.sln in order to do the builds, I noticed that the properties were set to v120 and not v120_xp but setting them does not seem to make any difference and the build worked. In fact, closing the project and re-opening it shows that the setting is not saved.

After building, when I run opencpn from within VS, everything works as it should. Initially the graphics were a bit screwed up but I noticed dome of the data sub folders were in the wrong place. Maybe when I have all this going, I could help in clearing up a couple of ambiguities that confused me in the compiling instructions on the website.

One final question. I am not clear how to get the VS debugger to invoke a plugin so I can step through it. I can see the PI manager scanning the plugin folder for *_pi.dll's and not finding any. Do I have to open the pi.sln in a different instance of VS or something?

Thanks

David
Cags is offline   Reply With Quote
Old 07-08-2015, 07:11   #21
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN Development

David...
You have 3 options:
  • Copy the plugin DLLs you want to debug to the location where we look for them (SRC\build\plugins if I remember well, it is in your logfile)
  • Change https://github.com/OpenCPN/OpenCPN/b...nager.cpp#L245 to point directly to the folder where your plugin is built (SRC\build\plugins\grib_pi\Debug, for example). (This is my preferred way to do it as I rarely work on more than one plugin at a time)
  • Come with a brilliant cross-platform solution saving you doing one of the above
Can't say anything new about your toolchain version problems, it simply never is like that here. The build will "always work", but it's result will not be what it should if the settings are wrong/mixed. Even more weird is that your VS is not saving the changes even if you make them manually.



Yes, please, update the instructions, I hope you will be the one that finally "gets it right" - I did what I could but it obviously does not work and your predecessors complaining exactly the same as you obviously did not improve it much.

Pavel
nohal is offline   Reply With Quote
Old 07-08-2015, 11:46   #22
Registered User

Join Date: Aug 2015
Posts: 17
Re: OpenCPN Development

Pavel,

Up and running A1.
Thanks for all your help. I'll set about throwing my experiences on top of the instructions while it's still fresh in my mind. If there's anything I should know or any rules I should adhere to - speak now.

Thanks again.

David
Cags is offline   Reply With Quote
Old 07-08-2015, 11:51   #23
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN Development

David...
No specific rules, just try to make it better, not worse We can keep improving it later.

Pavel
nohal is offline   Reply With Quote
Old 20-05-2017, 21:28   #24
Registered User

Join Date: May 2017
Posts: 9
Re: OpenCPN Development

I have source file of OPENCPN 4.4 and i changed file languge (.po). i want to rebuild to setup file. how to rebuild? help me, thanks for help
tamduy36 is offline   Reply With Quote
Old 21-05-2017, 08:05   #25
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: OpenCPN Development

Quote:
Originally Posted by tamduy36 View Post
I have source file of OPENCPN 4.4 and i changed file languge (.po). i want to rebuild to setup file. how to rebuild? help me, thanks for help

The answer depends on the OS you are targeting. Assuming you have a Windows build environment already working this command will create an installation package:

cmake –build . –config release –target package

If you have never compiled this program before there is a lot of work required to set up a build environment.

Why are you working with old version 4.4? Latest version is 4.6.1.
transmitterdan is offline   Reply With Quote
Old 21-05-2017, 08:23   #26
Registered User

Join Date: May 2017
Posts: 9
Re: OpenCPN Development

Thank you, transmitterdan. Can you show me more, step by step? i am not programmer. i read on OPENCPN Page but i don not understand. do you have an account on facebook or etc..
tamduy36 is offline   Reply With Quote
Old 24-05-2017, 22:35   #27
Registered User

Join Date: May 2017
Posts: 9
Re: OpenCPN Development

When I Config "build" Using Cmake_gui, the error appears as follows:
---------------------------------------------------------------------------------------
Code:
CMake Error at plugins/chartdldr_pi/cmake/PluginConfigure.cmake:70 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.
Call Stack (most recent call first):
  plugins/chartdldr_pi/CMakeLists.txt:32 (INCLUDE)


Found OpenGL...
    Lib: glu32opengl32GLU_staticopengl32
    Include: 
Chartdldr_pi building with embedded tinyxml
Install Prefix: C:/Program Files/OpenCPN

*** Staging to build dashboard_pi ***
CMake Error at plugins/dashboard_pi/CMakeLists.txt:73 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.


*** Staging to build grib_pi ***
CMake Error at plugins/grib_pi/CMakeLists.txt:73 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.


*** Staging to build wmm_pi ***
CMake Error at plugins/wmm_pi/cmake/PluginConfigure.cmake:70 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.
Call Stack (most recent call first):
  plugins/wmm_pi/CMakeLists.txt:22 (INCLUDE)
----------------------------------------------------------------------------------
Please help me fix it
Attached Thumbnails
Click image for larger version

Name:	build error.PNG
Views:	147
Size:	164.4 KB
ID:	148360  
tamduy36 is offline   Reply With Quote
Old 25-05-2017, 06:08   #28
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: OpenCPN Development

Quote:
Originally Posted by tamduy36 View Post
When I Config "build" Using Cmake_gui, the error appears as follows:
---------------------------------------------------------------------------------------[CODE]
CMake Error at plugins/chartdldr_pi/cmake/PluginConfigure.cmake:70 (INCLUDE):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
plugins/chartdldr_pi/CMakeLists.txt:32 (INCLUDE)
It is impossible to say what is wrong based on the error message. It is best not to use the cmake gui but just use the cmake at the command line. What version of visual studio do you have? What version of OpenCPN are you trying to build? What is the output of this command?

git status
transmitterdan is offline   Reply With Quote
Old 25-05-2017, 09:49   #29
Registered User

Join Date: May 2017
Posts: 9
Re: OpenCPN Development

Quote:
Originally Posted by transmitterdan View Post
It is impossible to say what is wrong based on the error message. It is best not to use the cmake gui but just use the cmake at the command line. What version of visual studio do you have? What version of OpenCPN are you trying to build? What is the output of this command?

git status
-----------------------------------------------------------------
i have VS2013 Community, Cmake, wxWidgets-3.1.0., Poedit, Git
PATH ----OK
Here are the order of steps I did:

3. Get the OpenCPN source

Run Developer Command Prompt for VS2013 from Start menu → Programs → Microsoft Visual Studio → Visual Studio Tools

To get the source for the first time, from your local github directory or local git repository issue
Code:
git clone git://github.com/OpenCPN/OpenCPN.git
----------------ok-------------------------------------------------------
I have a folder "OpenCPN"->Source code
--------------------------------------------------------------------------
3.1 Get the binary dependencies
Get OpenCPN_buildwin.7z and extract the dependencies into buildwin directory. The buildwin directory after extraction should look like this:
Directories
--------------
crashrpt
expat-2.1.0
gtk
NSIS_Unicode
vc
wxWidgets

Files
-------------
zlib1.dll
libcurl.dll
libcurl.lib
ocpn_gltest1.exe
Toolchain-mingw32.cmake
4 Build OpenCPN

Run Developer Command Prompt for VS2013
From Start menu → Programs → Microsoft Visual Studio → Visual Studio Tools.
Change Directory [CD} into your the topmost source directory.
Create a directory named “build” under the topmost source directory.
mkdir build
4.1a – Configure "build" from VS Command Prompt:
Use of the VS Command Prompt and CMake commands
Change Directory [CD]
Code:
cd build
cmake -T v120_xp ..
--------------------------------------------------the result like pic below.........
Attached Thumbnails
Click image for larger version

Name:	dev opencpn 2.PNG
Views:	83
Size:	82.9 KB
ID:	148389  
tamduy36 is offline   Reply With Quote
Old 25-05-2017, 11:28   #30
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: OpenCPN Development

Your wxWidgets installation is not correct. That is why you get and error during cmake configuration. This is a common problem. Type set at the command prompt and post the result for all environment variables that begin with the letters "wx". Probably the variable "WXWIN" is not set right or the wxWidgets dll files are not available.
transmitterdan is offline   Reply With Quote
Reply

Tags
enc, men, opencpn

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 PlugIn Development bdbcat OpenCPN 161 04-09-2019 13:50
Contribution to OpenCPN Development registry OpenCPN 37 02-04-2013 01:21
New Marina Development in China GordMay Pacific & South China Sea 4 29-09-2009 05:33
News: interesting development craft - high speed landing craft Amgine Multihull Sailboats 0 03-11-2008 12:30
Turks and Caicos Development Petition Canibul Atlantic & the Caribbean 5 24-04-2008 19:15

Advertise Here


All times are GMT -7. The time now is 13:06.


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.