andrewrk / libsoundio

C library for cross-platform real-time audio input and output
http://libsound.io/
MIT License
1.9k stars 230 forks source link

Build VS2022 Community Edition has failed #255

Open asergunov opened 2 years ago

asergunov commented 2 years ago

The only problem is missing stdatomic.h

libsoundio\src\atomics.h(48,10): fatal error C1083: Can't open include: stdatomic.h: No such file or directory, [libsoundio\build\latency.vcxproj]

The same error on MSVC 2019 and 2017

gzaffin commented 1 year ago

Compiling problem is still present in Win11 + MSVC 2022 but there is more : unistd.h inclusion, GNU attribute extension usage, etc.

-- Could NOT find COREAUDIO (missing: COREAUDIO_LIBRARY COREAUDIO_INCLUDE_DIR)
-- Looking for audioclient.h
-- Looking for audioclient.h - found
-- Found WASAPI: 1

Installation Summary
--------------------
* Install Directory            : C:/Program Files (x86)/libsoundio
* Build Type                   : Release
* Build static libs            : ON
* Build examples               : ON
* Build tests                  : ON

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

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gzaff/Devs/libsoundio/build-win64

C:\Users\gzaff\Devs\libsoundio\build-win64>cmake --build . --config Release
MSBuild version 17.3.1+2badb37d1 for .NET Framework
  Checking Build System
  Building Custom Rule C:/Users/gzaff/Devs/libsoundio/CMakeLists.txt
  soundio.c
C:\Users\gzaff\Devs\libsoundio\src\util.h(89,23): warning C4244: 'return': conversion from 'const double' to 'int', pos
sible loss of data [C:\Users\gzaff\Devs\libsoundio\build-win64\libsoundio_shared.vcxproj]
C:\Users\gzaff\Devs\libsoundio\src\util.h(93,43): warning C4244: 'initializing': conversion from '__int64' to 'const do
uble', possible loss of data [C:\Users\gzaff\Devs\libsoundio\build-win64\libsoundio_shared.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\stdatomic.h(15,1): fatal  err
or C1189: #error:  <stdatomic.h> is not yet supported when compiling as C, but this is planned for a future release. [C
:\Users\gzaff\Devs\libsoundio\build-win64\libsoundio_shared.vcxproj]
churchianity commented 1 year ago

image

Happens for me as well, but may be a separate issue, I'm not sure - using VS 2022.

Edition Windows 10 Home
Version 21H1
Installed on    ‎2020-‎09-‎10
OS build    19043.2130
Experience  Windows Feature Experience Pack 120.2212.4180.0