Setting build target in CLion

后端 未结 3 2127
粉色の甜心
粉色の甜心 2021-02-19 00:41

I\'m trying to set up CLion (windows 8.1, 64-bit, using cygwin and not mingw), and I\'m trying to compile+run a project, but I don\'t know what to do here:

相关标签:
3条回答
  • 2021-02-19 01:14

    Check in CMakeLists.txt that the line set(SOURCE_FILES main.cpp ... does not reference files that does not exist. It solved it for me.

    0 讨论(0)
  • 2021-02-19 01:21

    I believe, the problem is, your Compiler/Cmake environment is not set. Check File/Settings/Build, Execution, Deployment/Toolchain setup before editing the configuration.

    0 讨论(0)
  • 2021-02-19 01:23

    At the end of your CMakeLists.txt you should have a line that reads:

    add_executable(MyTarget ${SOURCE_FILES})
    

    This line specifies the name of your target (the executable is generated with this name).

    If you don't have this line, add it and click on the "Reload changes" link at the top. This line should have been created when CLion created your project.

    0 讨论(0)
提交回复
热议问题