andrewrk / libsoundio

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

Trying to Compile the Library on WIndows 10 Home, VS 2022 #271

Closed churchianity closed 1 year ago

churchianity commented 1 year ago

https://user-images.githubusercontent.com/43279719/200906697-5f87db89-5b82-4aa7-9ba0-a64b4ae576d0.png

I've been struggling trying to get this library to compile, which is a shame, since the API generally looks great and does what I want.

It first complains about stdatomic.h not being available when compiling in C mode. Fair enough. I don't know a good way to force everything to compile in C++ mode, since I use cmake as little as possible, and don't know much about cl or link.exe's flags, so I made every .c file a .cpp file, and re-compiled.

Still an error, now about being unable to find <unistd.h>, but after inspecting it looks like that was coming from the test suite, so I just modified CMakeLists.txt to not compile the tests, and while I was at it I stopped the compilation of the example programs too.

Now, finally, running:

cmake -S . -B build
msbuild build/ALL_BUILD.vcxproj

Succeeds...? But where is the .lib. I'm interested in the static library. I can't find it anywhere? Did I mess something up horribly?

churchianity commented 1 year ago

I was going to go for version 2.0.0, but I gave up and went with the pre-compiled libraries for an older version.