Fix: compilation Issue on ARM64 (msys2 clangarm)#25834
Conversation
|
Hello, my sample
(I know this is only armchair theory, not reality.) Instead of definiton https://github.com/opencv/opencv/blob/4.x/3rdparty/carotene/CMakeLists.txt endif()
endif()
+ if(MINGW) # TODO: What condition is better ?
+ target_compile_definitions(carotene_objs PRIVATE "-D_USE_MATH_DEFINES=1")
+ endif()
# we add dummy file to fix XCode build
add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$<TARGET_OBJECTS:carotene_objs>"
"${CAROTENE_SOURCE_DIR}/dummy.cpp")Or Add |
Added a definition for M_PI in the code to resolve a compilation error encountered when building OpenCV on the MSYS2 environment. The M_PI constant was not defined, causing the compilation to fail.
|
@Kumataro I have updated the PR to use _USE_MATH_DEFINES as suggested, by adding the following to CMakeLists.txt: I have compiled and tested this change on my local ARM machine, and it resolves the compilation issue successfully. Please review the changes and let me know if any further adjustments are needed. Thank you! |
|
I think the new patch is preferable as it limits the impact to the MINGW environment only. |
Added a definition for M_PI in the code to resolve a compilation error encountered when building OpenCV on the MSYS2 environment. The M_PI constant was not defined, causing the compilation to fail.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.