Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on windows 10 #4

Closed
arthmis opened this issue Jan 2, 2021 · 4 comments
Closed

Build error on windows 10 #4

arthmis opened this issue Jan 2, 2021 · 4 comments

Comments

@arthmis
Copy link

arthmis commented Jan 2, 2021

I know you haven't been able to test on windows so I'm just putting this here for your information.
The initial error I got was that libsoundio-sys needed cmake. So probably want to document that in the readme. After I installed cmake, this was the error I got. I don't really know what the issue is, but maybe you will.

I'm on windows 10 version 10.0.18363 Build 18363

error: failed to run custom build command for `libsoundio-sys v0.3.0 (https://github.com/jpochyla/soundio-rs?branch=static-callbacks#5000df22)`

Caused by:
  process didn't exit successfully: `C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-c1586ac3501b8a21\build-script-build` (exit code: 101)
  --- stdout
  running: "cmake" "C:\\Users\\Me\\.cargo\\git\\checkouts\\soundio-rs-21410f3b88cc1cd8\\5000df2\\libsoundio-sys\\libsoundio" "-G" "Visual Studio 15 2017" "-Thost=x64" "-Ax64" "-DBUILD_DYNAMIC_LIBS=OFF" "-DBUILD_STATIC_LIBS=ON" "-DBUILD_EXAMPLE_PROGRAMS=OFF" "-DBUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\Me\\Projects\\psst\\target\\release\\build\\libsoundio-sys-119d7aa244eb28dd\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Release"
  -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363.
  -- The C compiler identification is MSVC 19.16.27044.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Looking for pthread.h
  -- Looking for pthread.h - not found
  -- Found Threads: TRUE
  -- Looking for jack_set_port_rename_callback in jack
  -- Looking for jack_set_port_rename_callback in jack - not found
  -- Could NOT find JACK (missing: JACK_LIBRARY JACK_INCLUDE_DIR HAVE_jack_set_port_rename_callback)
  -- Could NOT find PULSEAUDIO (missing: PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR)
  -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
  -- Could NOT find COREAUDIO (missing: COREAUDIO_LIBRARY COREAUDIO_INCLUDE_DIR)
  -- Looking for audioclient.h
  -- Looking for audioclient.h - found
  -- Found WASAPI: 1
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/Me/Projects/psst/target/release/build/libsoundio-sys-119d7aa244eb28dd/out/build
  running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--"
  Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.

    Checking Build System
    Building Custom Rule C:/Users/Me/.cargo/git/checkouts/soundio-rs-21410f3b88cc1cd8/5000df2/libsoundio-sys/libsoundio/CMakeLists.txt
    soundio.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(89): warning C4244: 'return': conversion from 'const double' to 'int', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(93): warning C4244: 'initializing': conversion from '__int64' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\atomics.h(48): fatal error C1083: Cannot open include file: 'stdatomic.h': No such file or directory [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    util.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(89): warning C4244: 'return': conversion from 'const double' to 'int', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(93): warning C4244: 'initializing': conversion from '__int64' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    os.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(89): warning C4244: 'return': conversion from 'const double' to 'int', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(93): warning C4244: 'initializing': conversion from '__int64' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  C:\Users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\os.c(453): warning C4244: 'initializing': conversion from 'double' to 'DWORD', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  C:\Users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\os.c(614): warning C4244: 'return': conversion from 'const double' to 'size_t', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  C:\Users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\os.c(613): warning C4244: 'initializing': conversion from 'size_t' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  C:\Users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\os.c(622): warning C4267: 'function': conversion from 'size_t' to 'DWORD', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    dummy.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\atomics.h(48): fatal error C1083: Cannot open include file: 'stdatomic.h': No such file or directory [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    channel_layout.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(89): warning C4244: 'return': conversion from 'const double' to 'int', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(93): warning C4244: 'initializing': conversion from '__int64' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\atomics.h(48): fatal error C1083: Cannot open include file: 'stdatomic.h': No such file or directory [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    ring_buffer.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\atomics.h(48): fatal error C1083: Cannot open include file: 'stdatomic.h': No such file or directory [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    wasapi.c
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(89): warning C4244: 'return': conversion from 'const double' to 'int', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\util.h(93): warning C4244: 'initializing': conversion from '__int64' to 'const double', possible loss of data [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\atomics.h(48): fatal error C1083: Cannot open include file: 'stdatomic.h': No such file or directory [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]
    Generating Code...
  c:\users\Me\.cargo\git\checkouts\soundio-rs-21410f3b88cc1cd8\5000df2\libsoundio-sys\libsoundio\src\os.c(588): warning C4706: assignment within conditional expression [C:\Users\Me\Projects\psst\target\release\build\libsoundio-sys-119d7aa244eb28dd\out\build\libsoundio_static.vcxproj]

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  Configuring libsoundio version 2.0.0
  CMake Warning (dev) at C:/Users/Me/scoop/apps/cmake/3.19.2/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
    The package name passed to `find_package_handle_standard_args` (PULSEAUDIO)
    does not match the name of the calling package (PulseAudio).  This can lead
    to problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindPulseAudio.cmake:14 (find_package_handle_standard_args)
    CMakeLists.txt:65 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.

  CMake Warning (dev) at C:/Users/Me/scoop/apps/cmake/3.19.2/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
    The package name passed to `find_package_handle_standard_args` (COREAUDIO)
    does not match the name of the calling package (CoreAudio).  This can lead
    to problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindCoreAudio.cmake:14 (find_package_handle_standard_args)
    CMakeLists.txt:99 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.


  Installation Summary
  --------------------
  * Install Directory            : C:/Users/Me/Projects/psst/target/release/build/libsoundio-sys-119d7aa244eb28dd/out
  * Build Type                   : Release
  * Build static libs            : ON
  * Build examples               : OFF
  * Build tests                  : OFF

  System Dependencies
  -------------------
  * threads                      : OK
  * JACK       (optional)        : not found
  * PulseAudio (optional)        : not found
  * ALSA       (optional)        : not found
  * CoreAudio  (optional)        : not found
  * WASAPI     (optional)        : OK

  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_FLAGS
      CMAKE_ASM_FLAGS_RELEASE
      CMAKE_CXX_FLAGS
      CMAKE_CXX_FLAGS_RELEASE


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', C:\Users\Me\.cargo\registry\src\github.jparrowsec.cn-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5
@Bert-Proesmans
Copy link

https://github.com/andrewrk/libsoundio/blob/a46b0f21c397cd095319f8c9feccf0f1e50e31ba/src/atomics.h#L48

Does an import of header file "stdatomic.h", which is included in the C++11. I'm unsure which C++ standard is chosen by CMake. After some quick searches on the internet it doesn't look like MSVC has a complete C++11 implementation, so this might require waiting on MS, functionality stubbing, or moving to another sound backend.

You could try getting this to work through MinGW on Windows, but I cannot provide any specific instructions at this moment.
Ah man, I dislike all this toolchain mess and it puts me off having to deal with it every time.
The libsoundio project has no Windows build instructions (andrewrk/libsoundio#49). Cross-compilation is the only agreed-upon method to compile for Windows.

@arthmis
Copy link
Author

arthmis commented Jan 2, 2021

I'll try and see what I can do after some investigation. Just opening this up so you're made aware.

@jpochyla
Copy link
Owner

jpochyla commented Jan 3, 2021

I'll mention cmake in README, thanks for looking into this!

Although libsoundio works well on Mac, I'm not sure it's really being maintained much and I'd prefer to move to miniaudio once the 1.0 version with the high-level API and Vorbis codec is out and miniaudio-rs has corresponding bindings. We can also get rid of minivorbis at this point.

@jpochyla
Copy link
Owner

jpochyla commented Jan 3, 2021

I've decided to try miniaudio even before 1.0 to avoid build issues such as this, it's used in master now. Closing because libsoundio is not used anymore. Please open another issues in case of further problems. Thanks for patience!

@jpochyla jpochyla closed this as completed Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants