navit-gps / navit

The open source (GPL v2) turn-by-turn navigation software for many OS
http://www.navit-project.org
Other
559 stars 175 forks source link

Navit installer for Windows doesn't create maps folder #777

Open lexterror opened 5 years ago

lexterror commented 5 years ago

Navit installer for Windows doesn't create maps folder. Also won't load *.bin maps.

pgrandin commented 5 years ago

I had a look using a Windows 10 VM and I can confirm the following issues :

pgrandin commented 5 years ago

Progress! The issue with logs on win10 is that they are stored in a convoluted place instead of being next to the xml files. Something like C:\Users\John\AppData\Local\VirtualStore\Program Files (x86)\Navit

Navit created files, such as center.txt are also stored in a data subfolder there.

Now regarding the map issue :

error:map_binfile:module_map_binfile_init:error: sizeof(struct zip_cd)=zu
error:map_binfile:map_binfile_zip_setup:map file C:\Program Files (x86)\Navit/maps/munchen.bin: no index found
error:map_binfile:map_binfile_open:invalid file format for 'C:\Program Files (x86)\Navit/maps/munchen.bin'
jandegr commented 5 years ago

error:map_binfile:module_map_binfile_init:error: sizeof(struct zip_cd)=zu

There was a check for this in zipfile.h that would break compilation if the configuration of the build is not ok, but that check was removed in https://github.com/navit-gps/navit/commit/84ec04ba1ca2f36d591a297fa42a93a5f04de747#diff-9192dfcce35a26969c16e0cf0525bd39

Now you get an error at runtime instead of at compiletime and impossible to load any binfile.

Regards.

jandegr commented 5 years ago

A little more info, For toolchain file to build a 32bit version on a 64 bit box I have mingw-w64-i686.cmake

set(CMAKE_SYSTEM_NAME`` Windows)

set(TOOLCHAIN_PREFIX i686-w64-mingw32)

FIND_PROGRAM(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc) FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++) FIND_PROGRAM(CMAKE_RC_COMPILER_INIT NAMES i686-w64-mingw32-windres) FIND_PROGRAM(CMAKE_AR NAMES i686-w64-mingw32-ar)

target environment on the build host system set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})

modify default behavior of FIND_XXX() commands set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_CROSS_COMPILING TRUE)

but the most important might be that I added in CmakeLists.txt for windows builds set(HAVE_PRAGMA_PACK 1)

OFFTOPIC : from there on it took just a small number of little tweaks to get a 64bit build including maptool for windows

jkoan commented 5 years ago

Hi @jandegr, right now i was also looking at #659 which deals with the update from a 32bit build of navit to 64bit build for navit. Can we address this as well in the same move?

jandegr commented 5 years ago

I know the check in zipfile was cryptical but this is the message you would get and compilation would end with an error In file included from /root/project/navit/map/binfile/binfile.c:36:0: /root/project/navit/zipfile.h:171:6: error: size of array 'x' is negative int x[sizeof(struct zip_cd) == 46 ? 1:-1];

after restoring the check in zipfile to prevent future mishaps when crosscompiling for any platform, just add set(HAVE_PRAGMA_PACK 1) for windows desktop builds and navit on windows can read binfile again.

just wanted to give those hints so @pgrandin would not have to spend time debugging the issue.

regards.

jandegr commented 5 years ago

I might as well point out that smth. is wrong with speech on windows10 as well

Capture

Maybe this works on older windows versions but I am using winTTS on windows10 but it took a handfull of cpp code to make it work.

bignaux commented 5 years ago

with no much effort, you could build on normal zlib (not our in support). i succeed to build a working windows version and installer with nix, with dynamic loading of zlib1.dll and it fixed this error with zlib. I did also a 64bits installer for try, https://www64.zippyshare.com/v/7vpql3KZ/file.html to get it. I use no custom shell script or docker, just plain nix expression https://gist.github.com/bignaux/bd46b8f609f34c729db875a6f993ad09 https://www64.zippyshare.com/v/7vpql3KZ/file.html <- the zlib.dll to copy in the bin of the https://www64.zippyshare.com/v/lsk8lZOC/file.html <- 32bits installer.

jandegr commented 5 years ago

@bignaux this is the output of the version https://www64.zippyshare.com/v/7vpql3KZ/file.html it is also not showing any icon in gui_internal SPAGE_SIZE: 4096, SVALIGN:33554432 return dwTlsIndex = 0x3 error:map_binfile:module_map_binfile_init:error: sizeof(struct zip_cd)=48 error:navit:navit_get_user_data_directory:failed creating dir C:\Program Files\Navit053\data error:navit:navit_get_user_data_directory:failed creating dir C:\Program Files\Navit053\data error:map_textfile:map_rect_new_textfile:error opening textfile : Invalid argument error:navit:vehicle_new:invalid source 'gpsd://localhost': unknown type 'gpsd' error:map_binfile:map_binfile_open:Failed to load '$NAVIT_SHAREDIR/maps/osm_bbox_11.3,47.9,11.7,48.2.bin' error:navit:xinclude:Unable to include 'C:\Program Files\Navit053\$NAVIT_USER_DATADIR/navit_layout_*.xml' error:navit:navit_get_user_data_directory:failed creating dir C:\Program Files\Navit053\data error:navit:navit_get_user_data_directory:failed creating dir C:\Program Files\Navit053\data error:navit:xml_parse_file:could not open XML file error:navit:traffic_get_messages_from_xml_file:could not retrieve stored traffic messages

the version https://www64.zippyshare.com/v/lsk8lZOC/file.html complains for not finding zlib1.dll

IMHO you would want to do the fix I pointed to even in the case you later proceed to using zlib.dll. The 64 bit version also can include maptool.

FYI the 64bit version includes libsupport_zlib.a in a lib\navit folder together with some other static libs, I have no idea why any of these would be distributed in the windows version either. the 32 bit version does not include libsupport_zlib.a