Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 13-11-2014, 21:21   #31
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,019
Re: Linux cross compiling for windows failing

Jon...
I have updated the compilation instructions so that now the new versions of Poedit are mentioned first as most of the new readers will have them already.
BTW, it is all a wiki, so if you have an account on opencpn.org, you can make these changes directly - about the same amount of work as posting here and you'll be sure it gets done - although I try to follow all the meaningful posts and update the docs accordingly when needed, it's not always possible.

Cheers

Pavel
__________________

__________________
nohal is online now   Reply With Quote
Old 14-11-2014, 16:22   #32
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

Having now compiled and run OCPN under windows I can see that there is a difference in where the zlib is. Under windows there is a wxzlib*.lib file for linking. Under Linux with cross compiling the zlib is only incorporated in the Linux version of the wxwidget library, i.e. ones ending in "*.a", there is no DLL generated with the zlib components, i.e. gzopen, incorporated. This is probably why it is failing the link part.

There must be another option for the compiling of the wxWidgets library that will cause a DLL to include the zlib components. Does anyone know what it is?
__________________

__________________
jongough is offline   Reply With Quote
Old 14-11-2014, 16:24   #33
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

Pavel,
Thanks for doing that and telling me how to update the doco. I have now updated the Windows compile/run doco to fix up a couple of errors (missing '.'s) and to show how to run opencpn the first time without installing it. I will continue to update as and when I find things.

Jon

Quote:
Originally Posted by nohal View Post
Jon...
I have updated the compilation instructions so that now the new versions of Poedit are mentioned first as most of the new readers will have them already.
BTW, it is all a wiki, so if you have an account on opencpn.org, you can make these changes directly - about the same amount of work as posting here and you'll be sure it gets done - although I try to follow all the meaningful posts and update the docs accordingly when needed, it's not always possible.

Cheers

Pavel
__________________
jongough is offline   Reply With Quote
Old 15-11-2014, 21:53   #34
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

After failing to link properly because gzopen etc cannot be found I hunted around and eventually did a cross compile of zlib to generate libz.dll.a and zlib1.dll. I copied these to the wxWidgets-mingw directory and now the make completes successfully.

I had to issue this command in the zlib-1.2.8 directory
make -f win32/Makefile.gcc CC=/usr/bin/i686-w64-mingw32-gcc RC=/usr/bin/i686-w64-mingw32-windres

to get the windows DLL's produced.

Now I have a built version of opencpn.exe and the two plugins. I am not sure it will work as I think there may still be a problem with the InterlockedCompareExchange, which I got around by commenting out the
SET( CMAKE_EXE_LINKER_FLAGS "../buildwin/mingw-export-symbols.def" )
line in CMakeLists.txt

I have tried to run opencpn.exe under wine, but it fails with a:
wine: Unhandled page fault on write access to 0x0081ee6c at address 0x6f5263d0 (thread 000b), starting debugger..
message. I will have to try and track this down. But I want to see if it will acutally run under windows to make sure I am doing things correctly.
__________________
jongough is offline   Reply With Quote
Old 16-11-2014, 06:01   #35
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,816
Re: Linux cross compiling for windows failing

Now it built, but only has a run-time error?
Did you copy the needed gcc and mingw dll files?

Did you try a prebuilt mingw opencpn package? It should work under wine.
opencpnplugins - Browse /opencpn_mingw_experimental at SourceForge.net
__________________
boat_alexandra is offline   Reply With Quote
Old 28-11-2014, 15:01   #36
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

I have just managed to get back to the cross compiling and am now falling foul of NSIS and no Unicode support. The "make package" seems to generate a "project.nsi" file with "Unicode true" in it. However, NSIS 2.46-7, which is all that is currently available for Ubuntu does not have unicode support in it. The 3.0-beta apparently does have support but I am having trouble finding a copy that I can install.
__________________
jongough is offline   Reply With Quote
Old 28-11-2014, 17:52   #37
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,816
Re: Linux cross compiling for windows failing

I am using version nsis 3.0b, if you install that, it should work.

Otherwise, maybe you can disable unicode support in the installer? I'm not sure how it works for visual studio.

In any case, does the mingw opencpn.exe you built run ok?
__________________
boat_alexandra is offline   Reply With Quote
Old 28-11-2014, 18:02   #38
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,019
Re: Linux cross compiling for windows failing

Sean...
The NSIS packaging step comes to play after VS (or gcc) is done. And we kind of need the unicode version to support non-ASCII charsets in the installer. Of course it can be stripped out, but I don't see any reason why the unicode version should not work.
@Jon: the unicode version of 2.46 lives at Unicode NSIS

Pavel
__________________
nohal is online now   Reply With Quote
Old 29-11-2014, 00:43   #39
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

Pavel,
I may be missing something, but every unicode version of NSIS I can find is a windows exe file. If I get the source and try and compile it for unix it fails with all sorts of errors.

Jon

Quote:
Originally Posted by nohal View Post
Sean...
The NSIS packaging step comes to play after VS (or gcc) is done. And we kind of need the unicode version to support non-ASCII charsets in the installer. Of course it can be stripped out, but I don't see any reason why the unicode version should not work.
@Jon: the unicode version of 2.46 lives at Unicode NSIS

Pavel
__________________
jongough is offline   Reply With Quote
Old 29-11-2014, 07:29   #40
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,019
Re: Linux cross compiling for windows failing

Jon...
What errors are you getting? I have just built it successfully using:
Code:
tar xjf nsis-3.0b1-src.tar.bz2
cd nsis-3.0b1-src
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no PREFIX=. install-compiler
It does not mean that I know you need to build it at all, maybe you should run the Windows version under Wine...

Pavel
__________________
nohal is online now   Reply With Quote
Old 29-11-2014, 14:08   #41
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

Pavel,
I have just done what you did below with the 3.0b1 src and it built. I was getting errors with the 2.46 Unicode builds like:
g++ -o build/urelease/makensis/build.o -c -Wno-non-virtual-dtor -Wall -O2 -m32 "-DNSISCALL= __attribute__((__stdcall__))" -D_WIN32_IE=0x0500 -Ibuild/urelease/config Source/build.cpp
In file included from Source/build.cpp:24:0:
build/urelease/config/nsis-version.h:3:19: fatal error: tchar.h: No such file or directory
#include "tchar.h"
^
compilation terminated.

Now that I have built it I tried to run just makensis -h from the bin directory and got:
Error: opening stub "./share/nsis/Stubs/zlib-x86-ansi"
Error initalizing CEXEBuild: error setting default stub

I must be missing something at a fundamental level. I am being confused by the apparent mix between unix and windows directories, installation instructions, reference, etc.

Quote:
Originally Posted by nohal View Post
Jon...
What errors are you getting? I have just built it successfully using:
Code:
tar xjf nsis-3.0b1-src.tar.bz2
cd nsis-3.0b1-src
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no PREFIX=. install-compiler
It does not mean that I know you need to build it at all, maybe you should run the Windows version under Wine...

Pavel
__________________
jongough is offline   Reply With Quote
Old 29-11-2014, 15:29   #42
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,019
Re: Linux cross compiling for windows failing

Jon...
You should get the stubs from the binary distribution of NSIS (Open it as an archive).
They in theory are buildable with something like
Code:
scons SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no APPEND_CPPPATH=/usr/include/wine/windows PREFIX=. install-stubs
It fails for me (but I'm not trying to crosscompile, don't have the environment).

Pavel
__________________
nohal is online now   Reply With Quote
Old 29-11-2014, 20:09   #43
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Linux cross compiling for windows failing

I have tried running the opencpn.exe under both windows and a real win 7 machine (the one I used the MSVC compiler on), but I get a crash.

wine opencpn.exe
wine: Unhandled page fault on write access to 0x0081ee6c at address 0x6f5263d0 (thread 002d), starting debugger...
fixmele:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}


I have attached the backtrace file as well.


Quote:
Originally Posted by boat_alexandra View Post
I am using version nsis 3.0b, if you install that, it should work.

Otherwise, maybe you can disable unicode support in the installer? I'm not sure how it works for visual studio.

In any case, does the mingw opencpn.exe you built run ok?
Attached Thumbnails
Click image for larger version

Name:	windows error.jpg
Views:	80
Size:	26.0 KB
ID:	92554  
__________________

__________________
jongough is offline   Reply With Quote
Reply

Tags
linux, wind

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
Compiling OpenCPN Windows 8.1 Ptizef OpenCPN 4 22-07-2014 14:08
Compiling & Debug in Windows MSVC rgleason OpenCPN 1 04-07-2014 18:42
Compiling OpenCPN in Windows useris OpenCPN 20 29-06-2013 08:45
Compiling OCPN on Scientific Linux 6.4 64bit HotRod OpenCPN 6 23-05-2013 07:51
Display Differences - Like More Info - Using Linux vs Windows? sdowney717 OpenCPN 2 13-01-2012 12:17



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

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


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.