Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 24-05-2011, 10:07   #1
Registered User

Join Date: May 2011
Posts: 7
Building OpenCPN in Visual C++ 2008 Express - Errors

I've downloaded OpenCPN and want to build it under Windows. I followed the instructions on the OpenCPN website but when I try to compile the opencpn project I get, among other things, errors like this:

error C2440: 'type cast' : cannot convert from 'const wxCharBuffer' to 'LPCWSTR'

It uses this wxWidgets library for developing cross-platform Windows applications, which I've installed, as described in the developers' guide. So I don't know why it doesn't build.

Anyone got any ideas?

Cheers,

Steve
__________________

__________________
steve314 is offline   Reply With Quote
Old 24-05-2011, 15:51   #2
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

Quote:
Originally Posted by steve314 View Post
Anyone got any ideas?
I guess your problem has something to do with the needed Unicode support in wxWidgets for OpenCPN.

But I cannot remember exactly what to do - it was a little bit tricky (because even the documentation were wrong in some places).

Maybe this thread starting from this post may help you, too.

Sorry that I could not help you more ...

Good luck,
Gunther
__________________

__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 25-05-2011, 06:09   #3
Registered User

Join Date: Feb 2010
Posts: 619
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

For 2.4.506 I managed to get a clean compile and build with Unicode support etc. (except for post-build processing in PACKAGE, but that's another story).

For 2.4.523 I wanted to do better... so I made a fresh GIT repository, and followed the book on building. I still had to select wx28 Unicode libraries in the Linker command line by hand, and set project character sets to Unicode (why?).

During compile, I get the following warnings:

Code:
Building Custom Rule C:/Users/Tomek/opencpn/CMakeLists.txt
CMake does not need to re-run because C:\Users\Tomek\opencpn\buildwin\CMakeFiles\generate.stamp is up-to-date.
Compiling...
wvschart.cpp
tinyxmlparser.cpp
tinyxmlerror.cpp
...
...
routeman.cpp
pluginmanager.cpp
c:\users\tomek\opencpn\include\ocpn_plugin.h(227) : warning C4275: non dll-interface class 'wxObject' used as base for dll-interface class 'PlugInChartBase'
        C:\wx\include\wx/object.h(408) : see declaration of 'wxObject'
        c:\users\tomek\opencpn\include\ocpn_plugin.h(226) : see declaration of 'PlugInChartBase'
c:\users\tomek\opencpn\include\ocpn_plugin.h(283) : warning C4251: 'PlugInChartBase::m_FullPath' : class 'wxString' needs to have dll-interface to be used by clients of class 'PlugInChartBase'
        C:\wx\include\wx/string.h(659) : see declaration of 'wxString'
c:\users\tomek\opencpn\include\ocpn_plugin.h(288) : warning C4251: 'PlugInChartBase::m_EdDate' : class 'wxDateTime' needs to have dll-interface to be used by clients of class 'PlugInChartBase'
        C:\wx\include\wx/datetime.h(141) : see declaration of 'wxDateTime'
c:\users\tomek\opencpn\include\ocpn_plugin.h(291) : warning C4251: 'PlugInChartBase::m_Name' : class 'wxString' needs to have dll-interface to be used by clients of class 'PlugInChartBase'
...
...
Generating Code...
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Linking...
   Creating library C:\Users\Tomek\opencpn\buildwin\Release\opencpn.lib and object C:\Users\Tomek\opencpn\buildwin\Release\opencpn.exp
Embedding manifest...

Results
          
Build log was saved at "file://c:\Users\Tomek\opencpn\buildwin\opencpn.dir\Release\BuildLog.htm"
opencpn - 0 error(s), 72 warning(s)
The warnings pattern is repeated for all occurences of ocpn_plugin.h. All seems to work, except plugins - I get instant crash when plugins are present:

Code:
12:41:06: NMEA AutoPilot Port is....None
12:41:06: PlugInManager searching for PlugIns in location C:\Users\Tomek\opencpn\data\plugins
12:41:06: PlugInManager: Loading PlugIn: C:\Users\Tomek\opencpn\data\plugins/dashboard_pi.dll
12:48:36:
Vista, VC++

Thanks in advance for hints...

Piotr
__________________
PjotrC is offline   Reply With Quote
Old 25-05-2011, 06:28   #4
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 335
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

Which version of wxWidgets are you using?
__________________
SethDart is offline   Reply With Quote
Old 25-05-2011, 07:03   #5
Registered User

Join Date: Feb 2010
Posts: 619
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

wxWidgets 2.8.10, since September 2010 unchanged
__________________
PjotrC is offline   Reply With Quote
Old 25-05-2011, 07:51   #6
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 335
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

Well, my only guess is missing "DLL Unicode Debug" or "DLL Unicode Release" for wxWidgets or eventually wrong PATH for the compiled dll
__________________
SethDart is offline   Reply With Quote
Old 26-05-2011, 11:20   #7
Registered User

Join Date: Feb 2010
Posts: 619
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

Thanks, I will double-check the libraries...
What about compile warnings?
__________________
PjotrC is offline   Reply With Quote
Old 02-06-2011, 14:18   #8
Registered User

Join Date: Feb 2010
Posts: 619
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

I've followed balp's hint that 523 is not much different from 506, so I gave up trying to set up new environment from scratch and moved old 506's vcproject files over to new sources. A bit of hand combat and I am able to compile and run. Just building the PACKAGE still breaks on
Code:
# Run command: "C:/Program Files/NSIS/makensis.exe" "C:/Users/Tomek/opencpn/build/_CPack_Packages/win32/NSIS/project.nsi"
# Output:
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config: 
Processing plugin dlls: "C:\Program Files\NSIS\Plugins\*.dll"
 - AdvSplash::show

.......

 - nsExec::ExecToLog
 - nsExec::ExecToStack
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "C:\Users\Tomek\opencpn\build\_CPack_Packages\win32\NSIS"
Processing script file: "C:/Users/Tomek/opencpn/build/_CPack_Packages/win32/NSIS/project.nsi"
Invalid command: /*-----------------------------------------------------------------------------------------------------
Error in script "C:/Users/Tomek/opencpn/build/_CPack_Packages/win32/NSIS/project.nsi" on line 1 -- aborting creation process
I think that project.nsi is generated in UTF-8, while the automated process does not expect this.... running it by hand seems to work.

I guess this is still only a temporary solution, but at least I am able to do something.
__________________
PjotrC is offline   Reply With Quote
Old 02-06-2011, 14:50   #9
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
Re: Building OpenCPN in Visual C++ 2008 Express - Errors

Piotr,
I've never seen the problems you're experiencing, so I can just guess...
Is your NSIS the unicode version that's in the git repository? The official one does not work... If you install the one in git, don't forget to run the reg patch, that's also there.

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Reply

Thread Tools
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
Visual Passage Planner 2? gbanker Navigation 12 18-10-2015 21:51
Visual Passage Planner...any thoughts? Christian Van H Navigation 16 12-05-2014 23:12
A Look at Visual Navigation Suite 10.7 sded Navigation 6 03-11-2010 11:30
Building OpenCPN on a MacBook Pro NickA OpenCPN 55 23-09-2010 12:39
Building OpenCPN on Meego sailias OpenCPN 0 17-07-2010 15:02



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

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


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.