alnitak / flutter_soloud

Flutter low-level audio plugin using SoLoud C++ library and FFI
MIT License
221 stars 23 forks source link

fix: 'M_PI_2' undeclared identifier in window10 64bit #120

Closed ohho1220 closed 2 months ago

ohho1220 commented 2 months ago

I encountered the error 'error C2065: 'M_PI_2': undeclared identifier' when compiling version 2.1.0 on Windows 10 64-bit. I was able to resolve the issue by adding the following lines to the CMakeLists.txt file in the package's Windows folder:

if (MSVC) #line 24
    add_definitions (-D_CRT_SECURE_NO_WARNINGS)
    add_definitions (-D_USE_MATH_DEFINES) #add
endif()

Could you please confirm if this is the correct solution?

alnitak commented 2 months ago

Thanks @ohho1220 for your finding,

I have fixed by defining M_PI_2 if not already.