NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi I've been trying to compile Osmium Tool for Windows using Visual Studio and I can't get past this error and am not sure how to resolve it. Any help would be appreciated (unfortunately I don't know much about C++) but am trying my best! I see it was successful here but the artifacts are gone now. https://ci.appveyor.com/project/Mapbox/osmium-tool/build/1.0.281/job/va8388o8synhjii8

https://github.com/osmcode/osmium-tool

Used repo tag 1.13.2

Reviewed appveyor.yml

VS2019

    Installed Visual Studio 2019 (16.11.9)
    - installed desktop development with c++
    - installed MSVC v140 - VS 2015 C++ build tools (v14.00)

    Reviewed build-appveyor.bat
    - Updated vcvarsall.bat location for VS2019 install location (VC\Auxiliary\Build\vcvarsall.bat)
    - Changed cmake_cmd "Visual Studio 14 Win64" to "Visual Studio 16"
    - Changed toolsversion from 14.0 to Current

VS2015 community edition

    Reviewed build-appveyor.bat
    - Updated vcvarsall.bat location for VS2019 install location (VC\vcvarsall.bat)

    Downloaded lastest cmake, added to path C:\Program Files\CMake\bin

In C:\projects
    git clone --depth 1 https://github.com/osmcode/libosmium
    git clone --depth 1 https://github.com/mapbox/protozero

Download latest nuget.exe and placed in path

Downloaded boost 1.63 to C:/Libraries/boost_1_63_0
- ran bootstrap.bat
- ran b2.exe

Ran build-local.bat

ERRORS:

libboost_program_options-vc140-mt-1_63.lib(options_description.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' [C:\projects\osmium-tool\build\test\unit_tests.vcxproj]
Done Building Project "C:\projects\osmium-tool\build\test\unit_tests.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\projects\osmium-tool\build\test\unit_tests.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\projects\osmium-tool\build\ALL_BUILD.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\projects\osmium-tool\build\osmium.sln" (default targets) -- FAILED.

Build FAILED.

"C:\projects\osmium-tool\build\osmium.sln" (default target) (1) ->
"C:\projects\osmium-tool\build\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\osmium-tool\build\test\unit_tests.vcxproj.metaproj" (default target) (6) ->
"C:\projects\osmium-tool\build\test\unit_tests.vcxproj" (default target) (7) ->
(ClCompile target) -> 
  c:\projects\osmium-tool\test\include\catch.hpp(1648): warning C4800: 'osmium::io::overwrite': forcing value to bool 'true' or 'false' (performance warning) [C:\projects\osmium-tool\build\test\unit_tests.vcxproj]


"C:\projects\osmium-tool\build\osmium.sln" (default target) (1) ->
"C:\projects\osmium-tool\build\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\osmium-tool\build\src\osmium.vcxproj.metaproj" (default target) (4) ->
"C:\projects\osmium-tool\build\src\osmium.vcxproj" (default target) (5) ->
(Link target) -> 
  libboost_program_options-vc140-mt-1_63.lib(options_description.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' [C:\projects\osmium-tool\build\src\osmium.vcxproj]


"C:\projects\osmium-tool\build\osmium.sln" (default target) (1) ->
"C:\projects\osmium-tool\build\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\projects\osmium-tool\build\test\unit_tests.vcxproj.metaproj" (default target) (6) ->
"C:\projects\osmium-tool\build\test\unit_tests.vcxproj" (default target) (7) ->
  libboost_program_options-vc140-mt-1_63.lib(options_description.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' [C:\projects\osmium-tool\build\test\unit_tests.vcxproj]

    1 Warning(s)
    2 Error(s)

Time Elapsed 00:08:06.76
~~~~~~ ERROR C:\projects\osmium-tool\build-appveyor.bat ~~~~~~

asked 05 Feb '22, 19:20

aarismendi's gravatar image

aarismendi
56115
accept rate: 0%

edited 05 Feb '22, 19:23


permanent link

answered 06 Feb '22, 01:52

aarismendi's gravatar image

aarismendi
56115
accept rate: 0%

I have no problem opening, building and debugging in Visual Studio on Windows.
You need to make sure that all required c++ components are installed, incl cmake and vcpkg.

Tested on latest Visual Studio 2022 Community version, Windows 11.
My build artefacts: google drive.

Easy local build script using vcpkg, like github actions cmake and build:

  1. Install vcpkg https://github.com/microsoft/vcpkg#quick-start-windows
  2. Install cmake (set PATH environment) https://cmake.org/download/
  3. Cd work dir, clone osmium-tool, libosmium, protozero
  4. Copy build-local-vcpkg.bat (see google drive) to osmium-tool dir and launch
  5. The binaries dir: work-dir\osmium-tool\build\src\Release\

Should work without Visual Studio.

permanent link

answered 04 Mar '23, 10:34

Ildar's gravatar image

Ildar
2613
accept rate: 0%

edited 03 Oct '23, 18:26

For completeness, which Visual Studio version you were using?

(04 Mar '23, 10:46) SomeoneElse ♦

@SomeoneElse VS 2022, answer updated.

(04 Mar '23, 14:00) Ildar

Hi aarismendi, I also look for osmium.exe for windows. But I am not able to compile it by myself. Can you share the osmium.exe for windows ? If yes, please contact me thomas(at)img2ms.de

permanent link

answered 06 May '22, 21:27

morgen1's gravatar image

morgen1
111
accept rate: 0%

1

Just a thought - would Windows Subsystem for Linux be an option for you? That way you wouldn't have to be a small Windows dog on the floor waiting for he crumbs to fall off the Linux table :)

(06 May '22, 21:35) SomeoneElse ♦

I will try to install the linux subsystem... maybee it is the solution..

(07 May '22, 07:11) morgen1

There is no need to compile it for windows by yourself. There are ready to use compiled builds available at internet: My way : install anacaonda, it includes all binaries and the osmium.exe. After installing Anacanda, I get a directory \Anaconda3\Library\bin. Then i copied boost_program_options.dll; libbz2.dll;libexpat.dll;liblz4.dll;zlib.dll and osmium.exe to a other PC and can work with osmium.exe.

morgen1

permanent link

answered 04 Mar '23, 13:02

morgen1's gravatar image

morgen1
111
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×38

question asked: 05 Feb '22, 19:20

question was seen: 3,701 times

last updated: 03 Oct '23, 18:26

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum