User talk:MacOS development

From Navit's Wiki
(Redirected from Talk:MacOS development)
Jump to: navigation, search

Malloc error[edit]

param.c:3:20: error: malloc.h: No such file or directory
param.c: In function 'param_add_string':
param.c:10: warning: implicit declaration of function 'malloc'
param.c:10: warning: incompatible implicit declaration of built-in function 'malloc'

There is no malloc.h in OS X. All the defs are in stdlib.h. If you want you could make a softlink /opt/local/inlcude/malloc.h to /usr/include/stdlib.h, or just comment the relevants include <malloc.h>

Both will work. The symlink is maybe easier for now.

 ln -s /usr/include/stdlib.h /opt/local/include/malloc.h


We'll add a platform-test soon to fix it. If you want to add the test, feel free to submit a patch.

Included?[edit]

Buzz-Aldrin:NavIt skippern$ svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit navit

svn: 'navit' is already a working copy for a different URL

Buzz-Aldrin:NavIt skippern$

--Skippern 23:34, 3 October 2008 (CEST)

getline error[edit]

I'm trying to build Navit on OS X 10.5.6 and I hit the following error:

/bin/sh ../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall -Wcast-align -Wmissing-declarations
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE  -I/opt/local/include
-I/opt/local/include/gtk-2.0 -L/opt/local/lib -ffast-math -I../intl/   -o navit start.o  libnavit.la
-L/opt/local/lib -lgthread-2.0 -lglib-2.0 -lintl -liconv   -L/opt/local/lib -lgmodule-2.0 -lglib-2.0
-lintl -liconv   -lintl -Wl,-framework -Wl,CoreFoundation -lz -lintl -Wl,-framework -Wl,CoreFoundation
-Lfib-1.1 -lfib     -lm
gcc -g -O2 -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
-Wreturn-type -D_GNU_SOURCE -I/opt/local/include -I/opt/local/include/gtk-2.0 -ffast-math -I../intl/ -o navit
start.o -Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreFoundation  -L/opt/local/lib ./.libs/libnavit.a
/opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib /opt/local/lib/libglib-2.0.dylib -lz
/opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -L${HOME}/projects/navit/navit/fib-1.1
${HOME}/projects/navit/navit/fib-1.1/.libs/libfib.a -lm  
Undefined symbols:
  "_getline", referenced from:
      _navit_init in libnavit.a(navit.o)
ld: symbol(s) not found

Has anyone seen this? Which library should be supplying getline? --Fwiffo 11:15, 22 December 2008 (CET)

  • I do ran into the same issue. Looking for a solution... --Mathias 20:42, 10 January 2009 (CET)
  • Solved it by patching util.c (change putted to http://pastebin.com/f1cd3fab4) --Mathias
  • Since revision 2194, this should be in SVN, so you don't need that patch anymore. -- Tinloaf 11:24, 8 April 2009 (CEST)


AM_GNU_GETTEXT error?[edit]

Trying to build on Mac OS X 10.4.11 with Macports 1.7.1 Checked out svn revision 16258.

Did
sudo port install automake wget gpsd gtk2 glib2 libtool gettext

Did the changes described on Navit_on_MacOS page[1]

Running
./autogen.sh && ./configure --prefix=/opt/local

But get this error:

Copying file po/remove-potcdate.sin
aclocal: configure.in: 549: macro `AM_GNU_GETTEXT_VERSION' not found in library
aclocal: configure.in: 550: macro `AM_GNU_GETTEXT' not found in library
autoreconf: aclocal failed with exit status: 1

Any ideas? --Cagey 05:04, 2 July 2009 (UTC)


You can try downloading the src package from download.navit-project.org which doesn't need the autotools and also no installed gettext-tools (which is probably missing in your installation and leading to above error) --Cp15 12:28, 2 July 2009 (UTC)


Hey thanks, that worked. Got it to compile, but now another error running it. --Cagey 04:32, 4 July 2009 (UTC)

Invalid type 'gpsd'. No gui. No instance has been created, exiting.[edit]

Got navit-0.1.1 configured, made, and installed. Also did an install of gpsd from Macports. But running it from xterm:

$ navit     
navit:vehicle_new:invalid type 'gpsd'
navit:vehicle_new:invalid type 'gpsd'
navit:vehicle_new:invalid type 'gpsd'
navit:vehicle_new:invalid type 'gpsd'
navit:speech_new:wrong type 'cmdline'
navit:map_new:invalid type 'binfile'
navit:navit_init:no gui
navit:main:Using '/opt/local/share/navit/navit.xml'
navit:main:No instance has been created, exiting

Endian support error: cannot build[edit]

Really like this program under Gnu/Linux, and wanted to try it on Darwin, too. Grabbed the tarball (no subversion on my Darwin yet) dated 04.08.2009 from the svn site and had a relatively uneventful run of autogen and .config under 10.4.11. Shortly into make, I was told of a missing header file, "byteswap.h", included from data.h <- map.h <- map.c. Apparently, this was to have contained declarations for functions to re-endianize 16- and 32-bit integers. I wasn't trying to cross-compile for Intel, just for my old G4 (smaller and handier for travel).

This file doesn't seem to be in the include path. I noticed /opt/local/ is now added to the include and library paths for Darwin, so I don't think it's that. Any ideas? Thanks, + tschüß! Biergartler 07:35, 5 August 2009 (UTC)

Update -- 2009-08-13: Got the latest svn commit (2461, dated today) -- same problem. Here's the relevant output from make:
/../navit -DMODULE=map_mg -I/opt/local/include -g -O2 -I/opt/local/include -L/opt/local/lib -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -ffast-math -I../../../intl/ -MT map.lo -MD -MP -MF .deps/map.Tpo -c map.c  -fno-common -DPIC -o .libs/map.o
In file included from mg.h:24,
                 from map.c:26:
../../../navit/data.h:26:22: error: byteswap.h: No such file or directory
In file included from mg.h:24,
                 from map.c:26:
../../../navit/data.h: In function 'get_u16':
../../../navit/data.h:41: warning: implicit declaration of function '__bswap_16'
../../../navit/data.h: In function 'get_u32':
../../../navit/data.h:80: warning: implicit declaration of function '__bswap_32'
Any ideas? Vielen Dank! Biergartler 02:51, 14 August 2009 (UTC)

Same problem on my PowerBook G4 (PPC), solved partly (so make works!) by copying over byteswap.h from svn navit/tags/R0_1_0/navit/projs/CodeBlocks/Win32Extra/byteswap.h to navit/

Will give this a try when I get back to my iBook. Thanks + tschüß! Biergartler 02:32, 24 August 2009 (UTC)
Thank you, AnneGilles, but I cannot find these files or directories anywhere in commit 2562 dated 2009-09-07:
trunk $ du -a > files
trunk $ grep byteswap.h files
trunk $ grep tags files
trunk $ grep projs files
trunk $ grep R0_1_0 files
trunk $ grep CodeBlocks files
trunk $ grep Win32Extra files
trunk $
I don't usually use subversion, so I might be missing something. Navit built so easily on Linux. On Darwin, it's been extremely aggravating! Biergartler 05:43, 8 September 2009 (UTC)

To get byteswap.h you have to check out more than 'trunk' because release 0.1.0 is not in folder trunk but in folder 'tags' at the same level. -hth-

Thank you for the steer; the build directions do not mention this. I've added an ad hoc solution; it's maybe not the best way to handle this, but it gets me the header file. If you know of a more robust way, by all means, please edit the directions I've added. I was worried about a missing source file as well, but the swabbing is implemented as inline functions in the header file. One step closer -- yea! Biergartler 06:09, 13 September 2009 (UTC)

Updating build instructions[edit]

The build instructions for Darwin seem to have gotten a little out of date. config.in seems to have contained a test to add /opt/local/include to the include path on Darwin for some time. I've edited the build instructions to reflect this. I've also taken out the bit about gtk2 that appears superfluous. As I mentioned above, I've also included something about grabbing the byteswap.h file. Anything else to make the process friendlier? Biergartler 06:21, 13 September 2009 (UTC)

Python bindings[edit]

I'm on OSX 10.6 and I also had to use sudo port install python_select and subsequently run sudo python_select python26 before running configure. Before that I got

make[5]: *** [binding_python.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1

when running make Oschrenk 13:47, 19 Oktober 2009 (UTC)


I do not run sudo install python_select but I got the same result when running make (on OSX 10.6). the exact output:

...
gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
make[5]: *** [binding_python.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

--Epastor 05:53, 2 November 2009 (UTC)

Flawless build but exact same Python binding error messges above after 'make install'.

I should be building and installing for i386 only; why are multiple -arch flags being passed to gcc here?

UGLY HACK: I got a successful installation by editing the Makefile AFTER running configure to change the definition of PYTHON_CFLAGS, altering it to include only a single -arch flag (in my case,-arch i386):

PYTHON_CFLAGS = -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 

But there are many Makefile files with the problem. I must edit all of the files? I can make the change with configure? --Epastor 18:17, 10 March 2010 (UTC)

Navit doesn't display GUI images[edit]

I have this problem: Navit doesn't display GUI images that are .svg, .svgz or .xpm

I get this error:

 gui_internal:image_new_scaled:failed to load gui_map with 48,48
 gui_internal:image_new_scaled:failed to load gui_home with 48,48
 gui_internal:image_new_scaled:failed to load gui_actions with 96,96
 gui_internal:image_new_scaled:failed to load gui_settings with 96,96
 gui_internal:image_new_scaled:failed to load gui_tools with 96,96
 gui_internal:image_new_scaled:failed to load gui_settings with 96,96
 gui_internal:image_new_scaled:failed to load gui_about with 96,96
 gui_internal:image_new_scaled:failed to load gui_map with 48,48
 gui_internal:image_new_scaled:failed to load gui_home with 48,48
 gui_internal:image_new_scaled:failed to load gui_actions with 96,96
 gui_internal:image_new_scaled:failed to load gui_actions with 96,96

I'm on MacOs 10.6.2

SOLUTION

I solved installing ImageMagick ([2]) via MacPorts, and then I launched:

 cd $NAVIT_SHAREDIR/xpm
 for f in *.svg; do convert -background none -resize 48x48 $f 'basename $f .svg'_48_48.png; done

Has written here: [3]