在CLion中设置构建目标 [英] Setting build target in CLion

查看:306
本文介绍了在CLion中设置构建目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图设置CLion(Windows 8.1,64位,使用cygwin而不是mingw),并且我试图编译+运行项目,但是我不知道该怎么做:

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:

它说我需要一个目标和一个配置,但是下拉菜单中没有。我错过了配置步骤吗?

It says I need a Target and a Configuration, but there're none in the dropdown. Is there a configuration step I missed?

推荐答案

CMakeLists.txt 您应该在一行中输入以下内容:

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).

如果您没有此行,请添加它,然后单击顶部的重新加载更改链接。这行应该是在CLion创建项目时创建的。

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.

这篇关于在CLion中设置构建目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆