简体   繁体   中英

C++: CLion error: the clang compiler does not support '-march=core2

I have a problem with CLion compilation after updating CL tools - it must have overwritten some configurations in gcc/clang, but can't see how to change them.

When trying to compile with CLion or otherwise in command line, I get an error clang: error: the clang compiler does not support '-march=core2'

My CMkaeLists.txt includes standard

cmake_minimum_required(VERSION 3.22)
project(pythontest7)
set(CMAKE_CXX_STANDARD 17)
add_executable(pythontest7 main.cpp)

which was working all the time until today.

I've tried to reinstalling CL dev tools and Xcode and it didn't help. I tried to remove gcc from usr/bin but was not allowed to do it.

I imagine I should change the default march in clang but did no find how to do it. I am really stuck with it, appreciate any help.

经过数小时的配置,我发现这是一个特定于 M1 的问题:在将选项更改为cmake -DCMAKE_CXX_FLAGS='-march=apple-a14 -mcpu=cortex-a9 -mfloat-abi=hard'后,再次编译.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM