mattwallace
mattwallace

Reputation: 4222

clion cmake project not compiling: dyld mach-o, but built for simulator (not macOS)

I'm trying to build a C++ project using Clion and I get the following message in the console.

dyld: mach-o, but built for simulator (not macOS). If I try with debugger I get a failed to build target message.

It's worth noting that I started this project using clion on Windows and all the code compiles just fine on that OS. I'm guess this has to do with some gcc macOS issue and I'm not really sure.

Here is what is in my cmake.

cmake_minimum_required(VERSION 3.7)
project(Fractal_Creator)

if(APPLE)
    set(CCMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
    set(CMAKE_CXX_STANDARD 11)
endif()


set(SOURCE_FILES main.cpp BitmapFileHeader.h BitmapInfoHeader.h)
add_executable(Fractal_Creator ${SOURCE_FILES})

Upvotes: 0

Views: 834

Answers (1)

skalarproduktraum
skalarproduktraum

Reputation: 440

On line 5, you have CCMAKE_CXX_FLAGS, which should be CMAKE_CXX_FLAGS. As written in the comments above, this seems to fix the problem.

Upvotes: 1

Related Questions