Cruisers Forum
 


 
  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
Prev Previous Post   Next Post Next
Old 21-10-2014, 10:21   #1
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Unhappy Building OCPN on OS X

I'm trying to build OpenCPN on my Mac (OS X 10.10 Yoesmite), but I'm having a bit of trouble.
Pavel's updated build instructions are a help, and Gerhard - who has built OCPN on Yosemite - has given me some advice via PM, but I'm still not managing and I thought I'd post here rather than continue PM'ing so the solution is around for posterity.

I have Xcode 6.1, with the SDKs for 10.10 and 10.9 built into it. I have the SDK for 10.8 symlinked.
(I have an old Xcode 4 installer package around from which I will later try to extract the 10.7 SDK, but I know Gerhard managed to build against the 10.10 SDK so it shouldn't be necessary.)


I'm going to start by listing the problems I've had and 'solved', in case it helps anyone see where I'm going wrong.
My current problem is right at the bottom.


My first problem was with building wxWidgets. I was using the latest stable version, 3.0.2, as instructed on the build instructions page. But I was linking against the 10.9 SDK since I didn't have 10.7 and 10.9 was the oldest I had.

Not far into the build, I would get the following error:
Code:
/Users/caesar/Downloads/wxWidgets-3.0.2/bk-deps gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ -mmacosx-version-min=10.9 -c -o wxtiff_tif_lzma.o -DNDEBUG  -I./src/jpeg -I/Users/caesar/Downloads/wxWidgets-3.0.2/src/tiff/libtiff -I./src/tiff/libtiff -dynamic -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -I/Users/caesar/Downloads/wxWidgets-3.0.2/lib/wx/include/osx_cocoa-unicode-3.0 -I./include -Wall -Wundef -O2 -fno-strict-aliasing -fno-common  ./src/tiff/libtiff/tif_lzma.c
./src/tiff/libtiff/tif_lzma.c:38:10: fatal error: 'lzma.h' file not found
#include "lzma.h"
         ^
1 error generated.
make: *** [wxtiff_tif_lzma.o] Error 1
I was able to solve this error by passing the flag --disable-lzma to the configure script. Then, make would run for a very long time (an hour?) before throwing the following errors:
Code:
/Users/caesar/Downloads/wxWidgets-3.0.2/bk-deps g++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/ -mmacosx-version-min=10.10 -c -o webviewdll_osx_webview_webkit.o -I./.pch/wxprec_webviewdll -D__WXOSX_COCOA__      -DWXBUILDING -I/Users/caesar/Downloads/wxWidgets-3.0.2/src/tiff/libtiff -I./src/tiff/libtiff -I./src/jpeg -I./src/png  -I./src/regex  -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW -dynamic -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -I/Users/caesar/Downloads/wxWidgets-3.0.2/lib/wx/include/osx_cocoa-unicode-3.0 -I./include -O2 -fno-strict-aliasing  ./src/osx/webview_webkit.mm
./src/osx/webview_webkit.mm:392:30: warning: incompatible pointer types sending 'WebViewUIDelegate *' to parameter of type 'id<WKUIDelegate>' [-Wincompatible-pointer-types]
    [m_webView setUIDelegate:uiDelegate];
                             ^~~~~~~~~~
./src/osx/webview_webkit.mm:464:34: warning: 'WKPreferences' may not respond to 'setUsesPageCache:'
        [[m_webView preferences] setUsesPageCache:NO];
         ~~~~~~~~~~~~~~~~~~~~~~~ ^
./src/osx/webview_webkit.mm:466:34: warning: 'WKPreferences' may not respond to 'setUsesPageCache:'
        [[m_webView preferences] setUsesPageCache:YES];
         ~~~~~~~~~~~~~~~~~~~~~~~ ^
./src/osx/webview_webkit.mm:936:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/osx/webview_webkit.mm:954:25: error: cannot initialize a variable of type 'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 2 errors generated.
make: *** [webviewdll_osx_webview_webkit.o] Error 1
Following Gerhard's advice, I pulled the latest wxWidgets sources from Github, and used the following configure command:
Code:
../configure --with-osx_cocoa --enable-debug --enable-shared  --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk  --with-macosx-version-min=10.9 --enable-unicode --enable-mimetype=yes --disable-lzma
Then wxWidgets built successfully.


BUT... I wasn't able to build OpenCPN.
First I got the following error:
Code:
CMake Warning at /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/Platform/Darwin.cmake:179 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk

  because the directory does not exist.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
  CMakeLists.txt:43 (PROJECT)


CMake Error at /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/Platform/Darwin.cmake:211 (message):
  CMAKE_OSX_DEPLOYMENT_TARGET is '10.8' but CMAKE_OSX_SYSROOT:

   ""

  is not set to a MacOSX SDK with a recognized version.  Either set
  CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
  empty.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
  CMakeLists.txt:43 (PROJECT)


-- Configuring incomplete, errors occurred!
So then I installed the 10.8 SDK, and cmake would run fine.
But when I ran make, I got the following error...:
Code:
[  4%] Building CXX object CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/garmin_wrapper.cpp.o
In file included from /Users/caesar/dev/OpenCPN/src/garmin/jeeps/garmin_wrapper.cpp:22:
In file included from /Users/caesar/dev/OpenCPN/src/garmin/jeeps/garmin_wrapper.h:29:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
/usr/local/include/wx-3.1/wx/strvararg.h:22:14: fatal error: 'type_traits' file not found
    #include <type_traits>
             ^
1 error generated.
make[2]: *** [CMakeFiles/GARMINHOST.dir/src/garmin/jeeps/garmin_wrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/GARMINHOST.dir/all] Error 2
make: *** [all] Error 2
Suspecting that this was due to building against an older SDK than I'd used to build wxWidgets, I changed every mention of 10.8.sdk to 10.10.sdk in the CMakeCache.txt file. That solved that problem.


BUT... now I'm getting the following error.
Code:
[ 38%] Building CXX object CMakeFiles/OpenCPN.dir/src/chcanv.cpp.o
/Users/caesar/dev/OpenCPN/src/chcanv.cpp:4810:24: error: no member named 'LeftDown' in 'wxMouseState'; did you mean 'LeftIsDown'?
            if( !state.LeftDown() )
                       ^~~~~~~~
                       LeftIsDown
/usr/local/include/wx-3.1/wx/mousestate.h:71:10: note: 'LeftIsDown' declared here
    bool LeftIsDown()    const { return m_leftDown; }
         ^
/Users/caesar/dev/OpenCPN/src/chcanv.cpp:6645:70: error: no member named 'GetLabel' in 'wxMenuItem'
                                                  pimis->pmenu_item->GetLabel(), pimis->pmenu_item->GetHelp(),
                                                  ~~~~~~~~~~~~~~~~~  ^
/Users/caesar/dev/OpenCPN/src/chcanv.cpp:10901:32: error: no member named 'SetDividerPen' in 'wxGrid'
            ( (wxGrid*) win )->SetDividerPen(
            ~~~~~~~~~~~~~~~~~  ^
3 errors generated.
make[2]: *** [CMakeFiles/OpenCPN.dir/src/chcanv.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenCPN.dir/all] Error 2
make: *** [all] Error 2
I'm on the point of giving up, but I do really want to get this going so I can at least do some debugging and hopefully even contribute a few improvements to OCPN.

So, if anyone can help me here, I'd greatly appreciate it.

~ Caesar
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
 


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
Wood That Won't Warp For Building Entire Kitchen Counter, and Advice On Building Hatc albergsailor Monohull Sailboats 30 25-09-2012 09:15
How to use MMR2-C-Map card reader with OCPN ? Flemming Torp OpenCPN 6 28-05-2012 08:39
Pictures of OCPN in action. cagney OpenCPN 0 03-04-2012 09:16
Furuno and OCPN KrisCatteceur Navigation 2 12-01-2012 13:04
Does OCPN support NMEA 0183 v3.1? Netsurfer OpenCPN 5 25-05-2010 07:42

Advertise Here


All times are GMT -7. The time now is 11:47.


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.