Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 22-06-2015, 16:18   #31
Opu
Registered User

Join Date: Apr 2015
Posts: 8
Re: Building Opencpn using mingw (gcc) on Windows

Following Sean's instructions I have bumped into a linker problem when "making" OpenCN. The linker cannot find several wxWidgets libraries. I have searched the wxWidgets directory and the libraries do not exist, although there are libraries with somewhat similar names. I'm using wxWidgets 2.8.12.

The error messages are of the form:
<directory stuff>/ld.exe: cannot find -lwx_mswu_gl-2.8
<directory stuff>/ld.exe: cannot find -lwx_baseu_xml-2.8
and so on for a total of eight errors

The libraries with somewhat similar names are of the form:
wxmsw28u_gl_gcc_custom.dll
wxbase28u_xml_gcc_custom.dll

wxWidgets was compiled with:
configure --with-opengl --enable-unicode
make
make install

I don't know if it makes any difference, but the compiler suite is gcc 4.8.1.

Any one have any thoughts?
__________
Dick
__________________

__________________
Opu is offline   Reply With Quote
Old 23-06-2015, 04:13   #32
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,804
Re: Building Opencpn using mingw (gcc) on Windows

did you enable verbose makefiles? Maybe it cannot find the libraries? Is wx-config in the path? when you run wx-config --libs does it work? What terminal are you using, msys, cygwin or?

I haven't had a chance to try building from windows for a while because my main development computer died and I was forced to trade my power-hungry windows machine for a newer low-power linux one.


There isn't a huge amount of interest in mingw... what is your reason? (mine is to verify windows issues from linux) I am curious because I would like to merge the mingw branch at some point.
__________________

__________________
boat_alexandra is offline   Reply With Quote
Old 23-06-2015, 16:20   #33
Opu
Registered User

Join Date: Apr 2015
Posts: 8
Re: Building Opencpn using mingw (gcc) on Windows

I'm using msys/mingw because the environment is conducive to using several languages without having to switch between development environments (VC10, NetBeans, SciTE, ???). And I am using the msys terminal.

I checked wx-config and the missing libraries are in both the wxMSW and /usr/local/lib locations (although they are called lib... in /usr/local/lib). I don't know the tools well enough to figure out how to point the linker at the proper lib directory.

I have VC10 loaded; I'll give that a try.
____________
Dick
__________________
Opu is offline   Reply With Quote
Old 23-06-2015, 19:54   #34
Opu
Registered User

Join Date: Apr 2015
Posts: 8
Re: Building Opencpn using mingw (gcc) on Windows

I tried building with VC10 but the build failed during the link step. The linker reported:

LINK : fatal error LNK1104: cannot open file '..\buildwin\crashrpt\CrashRpt1402.lib'

The lib file appears in the correct .git subdirectory, but the file is not in the crashrpt directory. I'm a git novice, so I couldn't figure out how to have git extract the file. I tried checking out the lib file, but git said it had no knowledge of the file. I also tried copying, but I suspect the lib file is compressed, and I got the same failure. I'm guessing the linker is trying to write an error message to the crash report, but the message doesn't show up on the build output. VC10 and MinGW both fail during link and neither can find the (missing) library.

Sorry I can't provide a useful error report. Can someone suggest how I can get the library so the linker can (hopefully) report something meaningful?
____________
Dick
__________________
Opu is offline   Reply With Quote
Old 23-06-2015, 20:02   #35
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Building Opencpn using mingw (gcc) on Windows

Dick...
While building with Visual Studio, please follow Compiling - Windows | Official OpenCPN Homepage and make sure to do what it tells you, in this case to get the binary dependencies from Download opencpnplugins from SourceForge.net and populate the buildwin folder with them.
And of course do not build Sean's mingw branch with VS, use the master.

Pavel
__________________
nohal is online now   Reply With Quote
Old 23-06-2015, 20:58   #36
Opu
Registered User

Join Date: Apr 2015
Posts: 8
Re: Building Opencpn using mingw (gcc) on Windows

Thanks, Pavel. I misinterpreted the Binary Dependencies info. The main project now builds correctly, so I'm on to running the program locally.

Thanks again!
____________
Dick
__________________
Opu is offline   Reply With Quote
Old 23-06-2015, 21:31   #37
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Building Opencpn using mingw (gcc) on Windows

Any idea how we should rephrase it to be more clear? I promise not to work as a documentation writer, ever


Sent from my iPhone using Cruisers Sailing Forum
__________________
nohal is online now   Reply With Quote
Old 25-06-2015, 02:11   #38
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,804
Re: Building Opencpn using mingw (gcc) on Windows

Quote:
Originally Posted by Opu View Post
I'm using msys/mingw because the environment is conducive to using several languages without having to switch between development environments (VC10, NetBeans, SciTE, ???). And I am using the msys terminal.

I checked wx-config and the missing libraries are in both the wxMSW and /usr/local/lib locations (although they are called lib... in /usr/local/lib). I don't know the tools well enough to figure out how to point the linker at the proper lib directory.
I have rebased my mingw branch with upstream master, so you can try pulling. The build works fine for me (cross compiling in linux and running in wine) I just tested it and it works fine now with the latest source.

I think you need to copy the libraries into OpenCPN/buildwin/wxWidgets directory, eg:
Code:
~/build/OpenCPN $ ls buildwin/wxWidgets/
libgcc_s_sjlj-1.dll       wxbase28u_net_gcc_custom.dll  wxmsw28u_aui_gcc_custom.dll   wxmsw28u_html_gcc_custom.dll
libstdc++-6.dll           wxbase28u_xml_gcc_custom.dll  wxmsw28u_core_gcc_custom.dll
wxbase28u_gcc_custom.dll  wxmsw28u_adv_gcc_custom.dll   wxmsw28u_gl_gcc_custom.dll
~/build/OpenCPN $
Also if you build with "make" then I cannot be sure about "make install" on windows, I think it's better to use "make package" then run the installer
__________________
boat_alexandra is offline   Reply With Quote
Old 27-06-2015, 11:52   #39
Opu
Registered User

Join Date: Apr 2015
Posts: 8
Re: Building Opencpn using mingw (gcc) on Windows

In the interest of obtaining a set of files I could use to try some development ideas I have, I switched to VC10 and was able to build a debug executable. When I have a chance, I'll try pulling the newer version for MinGW to see if I can get that to build.

Thanks to everyone for their help.
____________
Dick
__________________
Opu is offline   Reply With Quote
Old 26-10-2016, 06:50   #40
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
Re: Building Opencpn using mingw (gcc) on Windows

Hi
This thread is quite old and I don't know if there is something younger... anyway,
I'm trying to cross-build for Windows from Ubuntu 16.10
Some news from the process described above
1) install mingw32 doesn't work anymore
instead I installed ming-w64
2) to build and install wxWidgets :
./configure --prefix=/usr/local/i686-w64-mingw32 --host=i686-w64-mingw32 --with-opengl --enable-unicode --built=x86_64

wxWidgets cmake, make, make install end successfully.

3) to build OpenCPN
Changed FindwxWidgets.cmake as indicated but I think it's no longer necessary

OpenCPN cmake ends successfully

Unfortunately, I'm blocked in make by a linker problem I'm unable to solve
I got these messages :

""
[ 37%] Linking CXX executable opencpn.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/opencpn.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/opencpn.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/opencpn.dir/objects.a @CMakeFiles/opencpn.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++ -mthreads -O3 -DNDEBUG -mwindows -Wl,--whole-archive CMakeFiles/opencpn.dir/objects.a -Wl,--no-whole-archive -o opencpn.exe -Wl,--out-implib,libopencpn.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/opencpn.dir/linklibs.rsp
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lcurl
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_gl-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu_net-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu_xml-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_html-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_adv-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_aui-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_core-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu-3.0
collect2: error: ld returned 1 exit status
CMakeFiles/opencpn.dir/build.make:2677 : la recette pour la cible « opencpn.exe » a échouée
make[2]: *** [opencpn.exe] Erreur 1
""


If somebody could help me
Thanks
Jean Pierre
__________________
Ptizef is offline   Reply With Quote
Old 26-10-2016, 17:11   #41
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,382
Re: Building Opencpn using mingw (gcc) on Windows

Jean Pierre, this is good, do you think you'll be able to update the mingw compile page, after you succeed? (keep recording the process here, ok?)

Compiling Windows MinGW | Official OpenCPN Homepage
__________________
rgleason is offline   Reply With Quote
Old 27-10-2016, 12:32   #42
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
Re: Building Opencpn using mingw (gcc) on Windows

Hi Rick
No problem to update the compile page, but first I have to be successful.
For the moment I'm lost in a linker problem ( described above ) and some help would
be very appreciated

Thanks
Jean Pierre
__________________
Ptizef is offline   Reply With Quote
Old 27-10-2016, 12:51   #43
Registered User

Join Date: Jul 2010
Location: Monastir, Tunisia
Boat: Amel Sharki
Posts: 1,774
Re: Building Opencpn using mingw (gcc) on Windows

Quote:
Originally Posted by Ptizef View Post
Hi Rick
No problem to update the compile page, but first I have to be successful.
For the moment I'm lost in a linker problem ( described above ) and some help would
be very appreciated

Thanks
Jean Pierre
I have no clue about Windows or Mingw. As you said you have compiled wxWidgets do you have compiled for a static or a dynamic library? Reading your error messages there was no way found to these libraries for the linker. You may check the path perhaps.

Gerhard
__________________
CarCode is online now   Reply With Quote
Old 27-10-2016, 18:28   #44
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,382
Re: Building Opencpn using mingw (gcc) on Windows

Jean Pierre, Sean knows this process, but I did it successfully once or twice with Sean's help. Then I improved Sean's orginal writeup which you see.

This section which seems to be hanging up was not a problem then.

Is this the first error? ..Can not find? lcurl ?
Is lcurl somewhere? If it is, why isn't it found? If it isn't there perhaps a step has been missed? -Some of these look like you might be missing having installed the mingw files? --keep in mind, it was a long time ago!

/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lcurl
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_gl-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu_net-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu_xml-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_html-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_adv-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_aui-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_mswu_core-3.0
/usr/bin/i686-w64-mingw32-ld : ne peut trouver -lwx_baseu-3.0
collect2: error: ld returned 1 exit status
__________________
rgleason is offline   Reply With Quote
Old 02-11-2016, 10:52   #45
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 743
Re: Building Opencpn using mingw (gcc) on Windows

Hi
thanks for your answers
I made progresses. The linker problem was due to called file names different from existing wxWidgets library.
After renaming its and some others tricks, I could build O successfully except the chartdldr_pi plug-in where I got link error messages :

""CMakeFiles/chartdldr_pi.dir/objects.a(chartdldr_pi.cpp.obj): dans la fonction « ZN12wxEvtHandler10DisconnectEiiiMS_FvR7wxEventEP8w xObjectPS_ »:
/usr/local/i686-w64-mingw32/include/wx-3.0/wx/event.h:3505: référence indéfinie vers « wxEVT_DOWNLOAD_EVENT »
CMakeFiles/chartdldr_pi.dir/objects.a(chartdldr_pi.cpp.obj): dans la fonction « ZN12wxEvtHandler7ConnectEiiiMS_FvR7wxEventEP8wxObj ectPS_ »:
/usr/local/i686-w64-mingw32/include/wx-3.0/wx/event.h:3478: référence indéfinie vers « wxEVT_DOWNLOAD_EVENT »
/usr/local/i686-w64-mingw32/include/wx-3.0/wx/event.h:3478: référence indéfinie vers « wxEVT_DOWNLOAD_EVENT »
collect2: error: ld returned 1 exit status
""
Still searching ...
Next step is building the package

thanks

Jean Pierre
__________________

__________________
Ptizef is offline   Reply With Quote
Reply

Tags
wind, opencpn, enc

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
How to share your Wi-Fi signal using a single card, under Windows 7 or 8 nigelmercier Marine Electronics 0 24-11-2013 03:45
Wood That Won't Warp For Building Entire Kitchen Counter, and Advice On Building Hatc albergsailor Monohull Sailboats 30 25-09-2012 10:15
Display Differences - Like More Info - Using Linux vs Windows? sdowney717 OpenCPN 2 13-01-2012 12:17
Building OpenCPN on a MacBook Pro NickA OpenCPN 55 23-09-2010 12:39
Raytech RNS and Windows 7 and Windows XP kene66 Marine Electronics 2 23-02-2010 15:50



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 03:54.


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.