Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-11-2014, 22:53   #16
Registered User

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

I have just got around to testing this again, been focusing on some changes to OCPN rather than cross compiling. Anyway...

I have just pulled the mingw stuff again and got the following message:

Linking CXX executable opencpn.exe
Cannot export InterlockedCompareExchange@12: symbol not found
collect2: error: ld returned 1 exit status


Is it possible to go back through the cross compiling instructions and check that they are complete/accurate? The sentence:
Copy the wxWidgets libraries into a folder here called wxWidgets-mingw
is confusing me. Which libraries, which files which destination folder?

Trying to cross compile on Ubuntu with wxWidgets it appears that the line:
cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake ..
needs some more information. When I get it to almost work my line is:
cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake -D wxWidgets_CONFIG_EXECUTABLE:FILEPATH=/opt/wxWidgets-2.8.12/wx-config ..

I am sure a wx directory of includes needs copying as well as a json set of includes. But as I am very new at this I do not really understand what is required and seem to be going around in circles.

Thanks
Jon

PS. Hope you are feeling better now.

Quote:
Originally Posted by boat_alexandra View Post
Sorry for the delayed reply. I got food poisoning...

Anyway, I found that libwxzlib-2.8.a is built by default, so --with-libz is set automatically.

Why I cannot get an environment variable with this value I am not sure, but I have updated the mingw branch so that it should just work without issues, but unfortunately only for a specific version of wx (See plugins/grib_pi/CMakeLists.txt)

WX_zlib:FILEPATH is not set in CMakeCache.txt, and adding zlib to wxWidgets_USE_LIBS doesn't seem to work either
__________________

__________________
jongough is offline   Reply With Quote
Old 10-11-2014, 01:02   #17
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

Quote:
Originally Posted by jongough View Post
I have just got around to testing this again, been focusing on some changes to OCPN rather than cross compiling. Anyway...

I have just pulled the mingw stuff again and got the following message:

Linking CXX executable opencpn.exe
Cannot export InterlockedCompareExchange@12: symbol not found
collect2: error: ld returned 1 exit status
Hmm...

which mingw?

Maybe mingw-w64 doesn't have this?
Quote:
Is it possible to go back through the cross compiling instructions and check that they are complete/accurate? The sentence:
Copy the wxWidgets libraries into a folder here called wxWidgets-mingw
is confusing me. Which libraries, which files which destination folder?
Needed only to create the installer package.

There is a folder OpenCPN/wxWidgets for msvc built wxWidgets,
so the files must go in OpenCPN/wxWidgets-mingw

Quote:
Trying to cross compile on Ubuntu with wxWidgets it appears that the line:
cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake ..
needs some more information. When I get it to almost work my line is:
cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake -D wxWidgets_CONFIG_EXECUTABLE:FILEPATH=/opt/wxWidgets-2.8.12/wx-config ..
Just do this instead:
Code:
export PATH=/opt/wxWidgets-2.8.12/:$PATH
cmake  -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake ..
Quote:
I am sure a wx directory of includes needs copying as well as a json set of includes. But as I am very new at this I do not really understand what is required and seem to be going around in circles.
No, only the libraries need to be copied. That's because wx-config handles everything, the problem is when building the package which doesn't find the libraries. It can probably be made to work automatically, but just isn't implemented in our cmake script yet.
__________________

__________________
boat_alexandra is offline   Reply With Quote
Old 10-11-2014, 13:24   #18
Registered User

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

OK. I have just done a clean clone of your repository into a new directory. I have mingw32 and mingw-w64 installed (my linux box is 64bit, my target windows box is Win 8.1 64 bit). I have both wxWidgets-2.8.12 and wxWidgets-3.0.2 on the system having done a make but not a make install. I have copied /opt/wxWidgets-2.8.12/lib/* to OpenCPN/wxWidgets-mingw/.

I tried the two commands

export PATH=/opt/wxWidgets-2.8.12/:$PATH cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake ..

and got this:

-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- *** Build Architecture is i386
-- *** Staging to build opencpn 3.3.2301 ***
-- *** Package will include documentation ***
-- *** Package will include GSHHS basechart level: CRUDE ***
-- *** Package will include tide and current data ***
-- Found OpenGL: opengl32
-- Found OpenGL...
-- Lib: glu32opengl32
-- Include:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find wxWidgets (missing: wxWidgets_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindwxWidgets.cmake:832 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:289 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/data/public/working area/opencpn/cross/OpenCPN/build-mingw32-cross/CMakeFiles/CMakeOutput.log".

So I ran:
cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake -D wxWidgets_CONFIG_EXECUTABLE:FILEPATH=/opt/wxWidgets-2.8.12/wx-config ..
-- *** Build Architecture is i386
-- *** Staging to build opencpn 3.3.2301 ***
-- *** Package will include documentation ***
-- *** Package will include GSHHS basechart level: CRUDE ***
-- *** Package will include tide and current data ***
-- Found OpenGL...
-- Lib: glu32opengl32
-- Include:
-- Found wxWidgets: TRUE
-- Found wxWidgets...
-- -L/opt/wxWidgets-2.8.12/lib;;-mthreads;;-Wl,--subsystem,windows;-mwindows;-lwx_mswu_gl-2.8-i586-mingw32msvc;-lwx_baseu_net-2.8-i586-mingw32msvc;-lwx_baseu_xml-2.8-i586-mingw32msvc;-lwx_mswu_html-2.8-i586-mingw32msvc;-lwx_mswu_adv-2.8-i586-mingw32msvc;-lwx_mswu_aui-2.8-i586-mingw32msvc;-lwx_mswu_core-2.8-i586-mingw32msvc;-lwx_baseu-2.8-i586-mingw32msvc
--
-- *** Staging to build opencpn ***
-- Build type: Release
-- *** Will install to /usr/local/i686-w64-mingw32 ***
-- Found Gettext: /usr/bin/msgmerge (found version "0.18.3")
-- tinyxml library not found
-- S57 ENC support: enabled
-- Garmin Host Mode support: enabled
-- Compiling texture compression library with sse support
--
-- *** Staging to build PlugIns ***
--
-- *** Staging to build dashboard_pi ***
-- *** Staging to build grib_pi ***
-- Writing spec file...
-- Configuring done
-- Generating done
-- Build files have been written to: /data/public/working area/opencpn/cross/OpenCPN/build-mingw32-cross

Then ran make and got:

Scanning dependencies of target GARMINHOST
[ 0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsapp.c.obj
[ 0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpscom.c.obj
[ 0%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsmath.c.obj
[ 1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsmem.c.obj
[ 1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsprot.c.obj
[ 1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsread.c.obj
[ 1%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice.c.obj
[ 2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice_ser.c.obj
[ 2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsdevice_usb.c.obj
[ 2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsrqst.c.obj
[ 2%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpssend.c.obj
[ 3%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsserial.c.obj
[ 3%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsutil.c.obj
[ 3%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsusbread.c.obj
[ 3%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsusbsend.c.obj
[ 4%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsusbcommon.c.obj
[ 4%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/garmin_wrapper_utils.c.obj
[ 4%] Building CXX object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/garmin_wrapper.cpp.obj
[ 4%] Building C object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/gpsusbwin.c.obj
Linking CXX static library libGARMINHOST.a
[ 4%] Built target GARMINHOST
Scanning dependencies of target NMEA0183
[ 4%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/latlong.cpp.obj
[ 6%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/long.cpp.obj
[ 6%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/nmea0183.cpp.obj
[ 6%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/response.cpp.obj
[ 6%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/rmb.cpp.obj
[ 7%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/sentence.cpp.obj
[ 7%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/talkerid.cpp.obj
[ 7%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/rmc.cpp.obj
[ 7%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/hexvalue.cpp.obj
[ 8%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/lat.cpp.obj
[ 8%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/expid.cpp.obj
[ 8%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/wpl.cpp.obj
[ 8%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/rte.cpp.obj
[ 9%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/hdt.cpp.obj
[ 9%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/hdg.cpp.obj
[ 9%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/hdm.cpp.obj
[ 9%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/gll.cpp.obj
[ 10%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/vtg.cpp.obj
[ 10%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/gga.cpp.obj
[ 10%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/gsv.cpp.obj
[ 10%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/GPwpl.cpp.obj
[ 12%] Building CXX object CMakeFiles/NMEA0183.dir/src/nmea0183/apb.cpp.obj
Linking CXX static library libNMEA0183.a
[ 12%] Built target NMEA0183
Scanning dependencies of target S57ENC
[ 12%] Building CXX object CMakeFiles/S57ENC.dir/src/TexFont.cpp.obj
[ 12%] Building CXX object CMakeFiles/S57ENC.dir/src/s52cnsy.cpp.obj
[ 12%] Building CXX object CMakeFiles/S57ENC.dir/src/s52plib.cpp.obj
[ 13%] Building CXX object CMakeFiles/S57ENC.dir/src/s52utils.cpp.obj
[ 13%] Building CXX object CMakeFiles/S57ENC.dir/src/s57chart.cpp.obj
[ 13%] Building CXX object CMakeFiles/S57ENC.dir/src/cm93.cpp.obj
[ 13%] Building CXX object CMakeFiles/S57ENC.dir/src/mygeom.cpp.obj
[ 14%] Building C object CMakeFiles/S57ENC.dir/src/tri.c.obj
[ 14%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddffielddefn.cpp.obj
[ 14%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddfmodule.cpp.obj
[ 14%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddfrecord.cpp.obj
[ 15%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddfsubfielddefn.cpp.obj
[ 15%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddffield.cpp.obj
[ 15%] Building CXX object CMakeFiles/S57ENC.dir/src/myiso8211/ddfutils.cpp.obj
[ 15%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ddfrecordindex.cpp.obj
[ 16%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_conv.cpp.obj
[ 16%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_csv.cpp.obj
[ 16%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_error.cpp.obj
[ 16%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_findfile.cpp.obj
[ 18%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_minixml.cpp.obj
[ 18%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_path.cpp.obj
[ 18%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_string.cpp.obj
[ 18%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cpl_vsisimple.cpp.obj
[ 19%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/cplgetsymbol.cpp.obj
[ 19%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ograssemblepolygon.cpp.obj
[ 19%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrcurve.cpp.obj
[ 19%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrfeature.cpp.obj
[ 20%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrfeaturedefn.cpp.obj
[ 20%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrfielddefn.cpp.obj
[ 20%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrgeometry.cpp.obj
[ 20%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrgeometrycollection.cpp.obj
[ 21%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrgeometryfactory.cpp.obj
[ 21%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrlinearring.cpp.obj
[ 21%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrlinestring.cpp.obj
[ 21%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrmultilinestring.cpp.obj
[ 22%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrmultipoint.cpp.obj
[ 22%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrmultipolygon.cpp.obj
[ 22%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrpoint.cpp.obj
[ 22%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrpolygon.cpp.obj
[ 24%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrs57datasource.cpp.obj
[ 24%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrlayer.cpp.obj
[ 24%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrs57layer.cpp.obj
[ 24%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/ogrutils.cpp.obj
[ 25%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/s57classregistrar.cpp.obj
[ 25%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/s57featuredefns.cpp.obj
[ 25%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/s57reader.cpp.obj
[ 25%] Building CXX object CMakeFiles/S57ENC.dir/src/mygdal/gdal_misc.cpp.obj
Linking CXX static library libS57ENC.a
[ 25%] Built target S57ENC
Scanning dependencies of target TEXCMP
[ 26%] Building C object CMakeFiles/TEXCMP.dir/src/texcmp/lz4/lz4.c.obj
[ 26%] Building C object CMakeFiles/TEXCMP.dir/src/texcmp/lz4/lz4hc.c.obj
[ 26%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/alpha.cpp.obj
[ 26%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/clusterfit.cpp.obj
[ 27%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/colourblock.cpp.obj
[ 27%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/colourfit.cpp.obj
[ 27%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/colourset.cpp.obj
[ 27%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/maths.cpp.obj
[ 28%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/rangefit.cpp.obj
[ 28%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/singlecolourfit.cpp.obj
[ 28%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/squish/squish.cpp.obj
[ 28%] Building CXX object CMakeFiles/TEXCMP.dir/src/texcmp/etcpak.cpp.obj
Linking CXX static library libTEXCMP.a
[ 28%] Built target TEXCMP
Scanning dependencies of target i18n
[ 28%] i18n [opencpn_ca_ES]: Created mo file.
[ 28%] i18n [opencpn_cs_CZ]: Created mo file.
[ 28%] i18n [opencpn_da_DK]: Created mo file.
[ 28%] i18n [opencpn_de_DE]: Created mo file.
[ 30%] i18n [opencpn_es_ES]: Created mo file.
[ 30%] i18n [opencpn_fr_FR]: Created mo file.
[ 30%] i18n [opencpn_it_IT]: Created mo file.
[ 30%] i18n [opencpn_nl_NL]: Created mo file.
[ 31%] i18n [opencpn_pl_PL]: Created mo file.
[ 31%] i18n [opencpn_ru_RU]: Created mo file.
[ 31%] i18n [opencpn_sv_SE]: Created mo file.
[ 31%] i18n [opencpn_et_EE]: Created mo file.
[ 32%] i18n [opencpn_pt_PT]: Created mo file.
[ 32%] i18n [opencpn_pt_BR]: Created mo file.
[ 32%] i18n [opencpn_nb_NO]: Created mo file.
[ 32%] i18n [opencpn_tr_TR]: Created mo file.
[ 33%] i18n [opencpn_fi_FI]: Created mo file.
[ 33%] i18n [opencpn_el_GR]: Created mo file.
[ 33%] i18n [opencpn_zh_TW]: Created mo file.
[ 33%] i18n [opencpn_hu_HU]: Created mo file.
[ 34%] i18n [opencpn_gl_ES]: Created mo file.
[ 36%] i18n: Done.
[ 36%] Built target i18n

Scanning dependencies of target opencpn
[ 36%] Building CXX object CMakeFiles/opencpn.dir/src/chart1.cpp.obj
[ 36%] Building CXX object CMakeFiles/opencpn.dir/src/bbox.cpp.obj
[ 37%] Building CXX object CMakeFiles/opencpn.dir/src/ocpn_pixel.cpp.obj
[ 37%] Building CXX object CMakeFiles/opencpn.dir/src/ocpndc.cpp.obj
[ 37%] Building CXX object CMakeFiles/opencpn.dir/src/chartdb.cpp.obj
[ 37%] Building CXX object CMakeFiles/opencpn.dir/src/chartdbs.cpp.obj
[ 38%] Building CXX object CMakeFiles/opencpn.dir/src/chartimg.cpp.obj
[ 38%] Building CXX object CMakeFiles/opencpn.dir/src/chcanv.cpp.obj
/data/public/working area/opencpn/cross/OpenCPN/src/chcanv.cpp: In member function Ďvoid ChartCanvas::CanvasPopupMenu(int, int, int)í:
/data/public/working area/opencpn/cross/OpenCPN/src/chcanv.cpp:6630:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
( i == g_GroupIndex - 1 ? l[1] : l[0] ) +

^
[ 38%] Building CXX object CMakeFiles/opencpn.dir/src/ocpCursor.cpp.obj
[ 38%] Building CXX object CMakeFiles/opencpn.dir/src/TCWin.cpp.obj
[ 39%] Building CXX object CMakeFiles/opencpn.dir/src/S57QueryDialog.cpp.obj
[ 39%] Building CXX object CMakeFiles/opencpn.dir/src/s57RegistrarMgr.cpp.obj
[ 39%] Building CXX object CMakeFiles/opencpn.dir/src/GoToPositionDialog.cpp.obj
/data/public/working area/opencpn/cross/OpenCPN/src/GoToPositionDialog.cpp:113:24: warning: extra tokens at end of #ifndef directive [enabled by default]
#ifndef wxCHECK_VERSION(3,0,0)

^
[ 39%] Building CXX object CMakeFiles/opencpn.dir/src/CM93DSlide.cpp.obj
[ 40%] Building CXX object CMakeFiles/opencpn.dir/src/RolloverWin.cpp.obj
[ 40%] Building CXX object CMakeFiles/opencpn.dir/src/ChInfoWin.cpp.obj
[ 40%] Building CXX object CMakeFiles/opencpn.dir/src/AISTargetQueryDialog.cpp.obj
[ 40%] Building CXX object CMakeFiles/opencpn.dir/src/AIS_Bitstring.cpp.obj
[ 42%] Building CXX object CMakeFiles/opencpn.dir/src/AISTargetListDialog.cpp.obj
[ 42%] Building CXX object CMakeFiles/opencpn.dir/src/AISTargetAlertDialog.cpp.obj
[ 42%] Building CXX object CMakeFiles/opencpn.dir/src/AIS_Decoder.cpp.obj
[ 42%] Building CXX object CMakeFiles/opencpn.dir/src/AIS_Target_Data.cpp.obj
[ 43%] Building CXX object CMakeFiles/opencpn.dir/src/OCPNListCtrl.cpp.obj
[ 43%] Building CXX object CMakeFiles/opencpn.dir/src/Quilt.cpp.obj
[ 43%] Building CXX object CMakeFiles/opencpn.dir/src/Hyperlink.cpp.obj
[ 43%] Building CXX object CMakeFiles/opencpn.dir/src/NavObjectCollection.cpp.obj
[ 44%] Building CXX object CMakeFiles/opencpn.dir/src/RoutePoint.cpp.obj
[ 44%] Building CXX object CMakeFiles/opencpn.dir/src/Route.cpp.obj
[ 44%] Building CXX object CMakeFiles/opencpn.dir/src/SelectItem.cpp.obj
[ 44%] Building CXX object CMakeFiles/opencpn.dir/src/Select.cpp.obj
[ 45%] Building CXX object CMakeFiles/opencpn.dir/src/FontMgr.cpp.obj
[ 45%] Building CXX object CMakeFiles/opencpn.dir/src/FontDesc.cpp.obj
[ 45%] Building CXX object CMakeFiles/opencpn.dir/src/OCPNSoundData.cpp.obj
[ 45%] Building CXX object CMakeFiles/opencpn.dir/src/OCPN_Sound.cpp.obj
[ 46%] Building CXX object CMakeFiles/opencpn.dir/src/NMEALogWindow.cpp.obj
[ 46%] Building CXX object CMakeFiles/opencpn.dir/src/TTYWindow.cpp.obj
[ 46%] Building CXX object CMakeFiles/opencpn.dir/src/TTYScroll.cpp.obj
[ 46%] Building CXX object CMakeFiles/opencpn.dir/src/SendToGpsDlg.cpp.obj
[ 48%] Building CXX object CMakeFiles/opencpn.dir/src/Layer.cpp.obj
[ 48%] Building CXX object CMakeFiles/opencpn.dir/src/concanv.cpp.obj
[ 48%] Building CXX object CMakeFiles/opencpn.dir/src/cutil.cpp.obj
[ 48%] Building CXX object CMakeFiles/opencpn.dir/src/georef.cpp.obj
[ 49%] Building CXX object CMakeFiles/opencpn.dir/src/navutil.cpp.obj
[ 49%] Building CXX object CMakeFiles/opencpn.dir/src/routeman.cpp.obj
[ 49%] Building CXX object CMakeFiles/opencpn.dir/src/routemanagerdialog.cpp.obj
[ 49%] Building CXX object CMakeFiles/opencpn.dir/src/routeprop.cpp.obj
/data/public/working area/opencpn/cross/OpenCPN/src/routeprop.cpp:618:24: warning: extra tokens at end of #ifndef directive [enabled by default]
#ifndef wxCHECK_VERSION(3,0,0)
^

[ 50%] Building CXX object CMakeFiles/opencpn.dir/src/routeprintout.cpp.obj
[ 50%] Building CXX object CMakeFiles/opencpn.dir/src/PositionParser.cpp.obj
[ 50%] Building CXX object CMakeFiles/opencpn.dir/src/printtable.cpp.obj
[ 50%] Building CXX object CMakeFiles/opencpn.dir/src/statwin.cpp.obj
[ 51%] Building CXX object CMakeFiles/opencpn.dir/src/tcmgr.cpp.obj
[ 51%] Building CXX object CMakeFiles/opencpn.dir/src/Station_Data.cpp.obj
[ 51%] Building CXX object CMakeFiles/opencpn.dir/src/IDX_entry.cpp.obj
[ 51%] Building CXX object CMakeFiles/opencpn.dir/src/TCDataFactory.cpp.obj
[ 53%] Building CXX object CMakeFiles/opencpn.dir/src/TCDS_Ascii_Harmonic.cpp.obj
[ 53%] Building CXX object CMakeFiles/opencpn.dir/src/TCDS_Binary_Harmonic.cpp.obj
[ 53%] Building CXX object CMakeFiles/opencpn.dir/src/TCDataSource.cpp.obj
[ 53%] Building CXX object CMakeFiles/opencpn.dir/src/thumbwin.cpp.obj
[ 54%] Building CXX object CMakeFiles/opencpn.dir/src/options.cpp.obj
[ 54%] Building CXX object CMakeFiles/opencpn.dir/src/gshhs.cpp.obj
[ 54%] Building CXX object CMakeFiles/opencpn.dir/src/kml.cpp.obj
[ 54%] Building CXX object CMakeFiles/opencpn.dir/src/undo.cpp.obj
[ 55%] Building CXX object CMakeFiles/opencpn.dir/src/about.cpp.obj
[ 55%] Building CXX object CMakeFiles/opencpn.dir/src/ais.cpp.obj
[ 55%] Building CXX object CMakeFiles/opencpn.dir/src/pluginmanager.cpp.obj
[ 55%] Building CXX object CMakeFiles/opencpn.dir/src/gpxdocument.cpp.obj
[ 56%] Building CXX object CMakeFiles/opencpn.dir/src/wxJSON/jsonwriter.cpp.obj
[ 56%] Building CXX object CMakeFiles/opencpn.dir/src/wxJSON/jsonreader.cpp.obj
[ 56%] Building CXX object CMakeFiles/opencpn.dir/src/wxJSON/jsonval.cpp.obj
[ 56%] Building CXX object CMakeFiles/opencpn.dir/src/chartsymbols.cpp.obj
[ 57%] Building CXX object CMakeFiles/opencpn.dir/src/razdsparser.cpp.obj
[ 57%] Building CXX object CMakeFiles/opencpn.dir/src/styles.cpp.obj
[ 57%] Building CXX object CMakeFiles/opencpn.dir/src/toolbar.cpp.obj
[ 57%] Building CXX object CMakeFiles/opencpn.dir/src/compasswin.cpp.obj
[ 59%] Building CXX object CMakeFiles/opencpn.dir/src/geodesic.cpp.obj
[ 59%] Building CXX object CMakeFiles/opencpn.dir/src/datastream.cpp.obj
[ 59%] Building CXX object CMakeFiles/opencpn.dir/src/OCPN_DataStreamEvent.cpp.obj
[ 59%] Building CXX object CMakeFiles/opencpn.dir/src/ConnectionParams.cpp.obj
[ 60%] Building CXX object CMakeFiles/opencpn.dir/src/OCP_DataStreamInput_Thread.cpp.obj
[ 60%] Building CXX object CMakeFiles/opencpn.dir/src/multiplexer.cpp.obj
[ 60%] Building CXX object CMakeFiles/opencpn.dir/src/pugixml.cpp.obj
[ 60%] Building CXX object CMakeFiles/opencpn.dir/src/OCPNRegion.cpp.obj
[ 61%] Building CXX object CMakeFiles/opencpn.dir/src/TrackPropDlg.cpp.obj
[ 61%] Building CXX object CMakeFiles/opencpn.dir/src/LinkPropDlg.cpp.obj
[ 61%] Building CXX object CMakeFiles/opencpn.dir/src/scrollingdialog.cpp.obj
[ 61%] Building CXX object CMakeFiles/opencpn.dir/src/glChartCanvas.cpp.obj
[ 62%] Building CXX object CMakeFiles/opencpn.dir/src/glTextureDescriptor.cpp.obj
[ 62%] Building CXX object CMakeFiles/opencpn.dir/src/glTexCache.cpp.obj
[ 62%] Building CXX object CMakeFiles/opencpn.dir/src/tinyxml.cpp.obj
[ 62%] Building CXX object CMakeFiles/opencpn.dir/src/tinyxmlerror.cpp.obj
[ 63%] Building CXX object CMakeFiles/opencpn.dir/src/tinyxmlparser.cpp.obj
Linking CXX executable opencpn.exe
Cannot export InterlockedCompareExchange@12: symbol not found
collect2: error: ld returned 1 exit status
make[2]: *** [opencpn.exe] Error 1
make[1]: *** [CMakeFiles/opencpn.dir/all] Error 2
make: *** [all] Error 2


Sorry for the length of the post, but I thought I should show you what happened when I tried to do the compile/link.
__________________
jongough is offline   Reply With Quote
Old 10-11-2014, 16:21   #19
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

Quote:
Originally Posted by jongough View Post
OK. I have just done a clean clone of your repository into a new directory. I have mingw32 and mingw-w64 installed (my linux box is 64bit, my target windows box is Win 8.1 64 bit). I have both wxWidgets-2.8.12 and wxWidgets-3.0.2 on the system having done a make but not a make install. I have copied /opt/wxWidgets-2.8.12/lib/* to OpenCPN/wxWidgets-mingw/.

I tried the two commands

export PATH=/opt/wxWidgets-2.8.12/:$PATH cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake ..
I think the path must be set to the build directory, or at least wherever wx-config is located.

Anyway, the way you got it to work should be ok too. The interlock compare exchange is quite annoying. Perhaps you can rebuild wxwidgets using i686-w64-mingw32-gcc because it appears to be built using i586-mingw32msvc.

I think the problem is something with the preprocessor or order of includes.

Thanks for sticking with this, I'm sure we can solve it.
__________________
boat_alexandra is offline   Reply With Quote
Old 10-11-2014, 22:39   #20
Registered User

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

I have rebuilt the wxwidgets using i686-w64-mingw32-gcc, but I still get the INterLockedCompareExchange message.
__________________
jongough is offline   Reply With Quote
Old 11-11-2014, 16:37   #21
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

The interlocked error is very annoying. I saw it months ago and forgot how it was fixed exactly.

My output:
Code:
$ nm -A /usr/i686-w64-mingw32/lib/*dll | grep Interlocked
/usr/i686-w64-mingw32/lib/libwinpthread-1.dll:64949af0 T __InterlockedCompareExchange
/usr/i686-w64-mingw32/lib/libwinpthread-1.dll:64949b10 T _InterlockedCompareExchange@12
/usr/i686-w64-mingw32/lib/libwinpthread-1.dll:64949b50 T __InterlockedExchangeAdd
/usr/i686-w64-mingw32/lib/libwinpthread-1.dll:64949b60 T _InterlockedExchangeAdd@8

$ nm -A /usr/local/i686-w64-mingw32/lib/*dll | grep Interlocked
/usr/local/i686-w64-mingw32/lib/wxbase28u_gcc_custom.dll:6946b7c0 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxbase28u_net_gcc_custom.dll:6b957660 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxbase28u_xml_gcc_custom.dll:6f821df0 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_adv_gcc_custom.dll:6465e3e0 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_aui_gcc_custom.dll:641bf450 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_core_gcc_custom.dll:6a13bd50 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_gl_gcc_custom.dll:6d809370 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_html_gcc_custom.dll:6f1c4d40 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_qa_gcc_custom.dll:6d991d50 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_richtext_gcc_custom.dll:695328e0 T _InterlockedCompareExchange@12
/usr/local/i686-w64-mingw32/lib/wxmsw28u_xrc_gcc_custom.dll:6474e370 T _InterlockedCompareExchange@12
Maybe in CMakeLists, libwinpthread needs to be added? I am not sure why I don't have this issue, but I might have made this change and forgot to /usr/i686-w64-mingw32/include/intrin.h starting line 280
Code:
    __MACHINEIA64(__MINGW_EXTENSION __int64 _InterlockedExchangeAdd64_rel(__int64 volatile *,__int64))                       
    __MACHINEX64(__MINGW_EXTENSION __int64 _InterlockedExchangeAdd64(__int64 volatile *,__int64))                            
                                                                                                                             
    //    __MACHINEI(__LONG32 _InterlockedCompareExchange (__LONG32 volatile *,__LONG32,__LONG32))                           
    //    __MACHINEIA64(long _InterlockedCompareExchange (long volatile *,long,long))                                        
    __MACHINEIA64(long _InterlockedCompareExchange_acq (long volatile *,long,long))                                          
    __MACHINEIA64(long _InterlockedCompareExchange_rel (long volatile *,long,long))                                          
    __MACHINEIA64(__MINGW_EXTENSION __int64 _InterlockedCompareExchange64(__int64 volatile *,__int64,__int64))
If these aren't commented out, you can try that, but you need to rebuild wxwidgets again I believe. It would be best to solve some other way without editing this file.
__________________
boat_alexandra is offline   Reply With Quote
Old 11-11-2014, 21:18   #22
Registered User

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

Commenting out the line:
__MACHINEIA64(long _InterlockedCompareExchange (long volatile *,long,long))

made no difference.

I found a line in CMakeLists.txt
# for some reason plugins cannot load without exporting InterlockedCompareExchange
# and I really don't have the patience to dig further, but this fixes the problem.
# alternately can export all symbols, but this causes collisions when plugins use
# identical libraries (ie tinyxml) and results in crashes
# SET( CMAKE_EXE_LINKER_FLAGS "../buildwin/mingw-export-symbols.def" )

which I commented out. The make got further, but then I am back with a zlib issue:

[100%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/smapi.cpp.obj
Linking CXX shared library libgrib_pi.dll
/usr/bin/i686-w64-mingw32-ld: cannot find -lwxzlib-2.8
collect2: error: ld returned 1 exit status


__________________
jongough is offline   Reply With Quote
Old 13-11-2014, 05:29   #23
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

Code:
$ locate libwxzlib-2.8.a
/usr/local/i686-w64-mingw32/lib/libwxzlib-2.8.a
It must be built with wxwidgets
__________________
boat_alexandra is offline   Reply With Quote
Old 13-11-2014, 05:31   #24
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

You may also try
$ make opencpn

to build without the plugins which won't work anyway unless you fix the symbols problem with the interlocked exchange.
__________________
boat_alexandra is offline   Reply With Quote
Old 13-11-2014, 06:43   #25
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,877
Re: Linux cross compiling for windows failing

jon....

Or you may try the production release tool, MS VS2010 Express.

Works fine.

Dave
__________________
bdbcat is offline   Reply With Quote
Old 13-11-2014, 07:03   #26
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

Quote:
Originally Posted by bdbcat View Post
jon....

Or you may try the production release tool, MS VS2010 Express.

Works fine.

Dave
This requires installing windows.

When cross compiling for windows under linux, it builds much faster on the same machine, and can be tested under wine. There is no need to install windows.
__________________
boat_alexandra is offline   Reply With Quote
Old 13-11-2014, 13:09   #27
Registered User

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

I have the following on the systems

/opt/./wxWidgets-3.0.2/lib/libwxzlib-3.0-i586-mingw32msvc.a
/opt/./wxWidgets-2.8.12/lib/libwxzlib-2.8-i586-mingw32msvc.a
/opt/./wxWidgets-2.8.12/lib/libwxzlib-2.8-i686-w64-mingw32.a
and I copied the two 2.8 library files into the OpenCPN/wxWidgets-mingw32 directory.

wxWidgets is made but not installed so I can point at either version.

I can find reference to the w64-mingw32 file in CMakeCache.txt in the root build directory and
plugins/grib_pi/CMakeFiles/grib_pi.dir/link.txt

But if I change these they get put back to the original setting as soon as I run make. There must be a configuration somewhere where I can point the files to the correct library with -L but I don't know where.

Quote:
Originally Posted by boat_alexandra View Post
Code:
$ locate libwxzlib-2.8.a
/usr/local/i686-w64-mingw32/lib/libwxzlib-2.8.a
It must be built with wxwidgets
__________________
jongough is offline   Reply With Quote
Old 13-11-2014, 18:00   #28
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,802
Re: Linux cross compiling for windows failing

Quote:
Originally Posted by jongough View Post
I have the following on the systems

/opt/./wxWidgets-3.0.2/lib/libwxzlib-3.0-i586-mingw32msvc.a
/opt/./wxWidgets-2.8.12/lib/libwxzlib-2.8-i586-mingw32msvc.a
/opt/./wxWidgets-2.8.12/lib/libwxzlib-2.8-i686-w64-mingw32.a
and I copied the two 2.8 library files into the OpenCPN/wxWidgets-mingw32 directory.

wxWidgets is made but not installed so I can point at either version.

I can find reference to the w64-mingw32 file in CMakeCache.txt in the root build directory and
plugins/grib_pi/CMakeFiles/grib_pi.dir/link.txt

But if I change these they get put back to the original setting as soon as I run make. There must be a configuration somewhere where I can point the files to the correct library with -L but I don't know where.
Edit OpenCPN/plugins/grib_pi/CMakeLists.txt line 138 so it can use
/opt/./wxWidgets-2.8.12/lib/libwxzlib-2.8-i686-w64-mingw32.a

OpenCPN should work already minus the grib plugin correct? Are you testing in wine?
__________________
boat_alexandra is offline   Reply With Quote
Old 13-11-2014, 20:19   #29
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Linux cross compiling for windows failing

Jon, Sean,

When you get this going, PLEASE update the wiki page on cross compiling.

I tried getting it going a week or so ago and failed.
I didn't spend a lot of time on it and can't remember exactly what went wrong in the end now.
I do know I got errors because the instructions say to build wx with 'i586...' but the build script was looking for 'i686...'. I changed the build script, that being quicker than recompiling wx, but then I had other errors which I don't recall now.

I'll come back to it when I get a chance...

Caesar
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 13-11-2014, 20:57   #30
Registered User

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

Dave
I have VirtualBox installed with a Win 7 that I can use. I have followed the instructions on how to get it working and there is a change that is needed to the doco. In the section GetText there is another path that has to be added or msgfmt.exe is not found. I had to added
"C:\Program Files\Poedit\GettextTools\bin"
to the path. Then the first cmake in the OCPN build directory worked.

I am trying to build a windows version of the code so that I can install it on my navigation PC. I would still like to be able to cross compile as running the compiler in a virtual machine does slow it down somewhat.

Jon

Quote:
Originally Posted by bdbcat View Post
jon....

Or you may try the production release tool, MS VS2010 Express.

Works fine.

Dave
__________________

__________________
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 06:48.


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.