Qt Creator c ++ 11通用项目的语法高亮 [英] Qt Creator c++11 syntax highlighting for generic projects

查看:1108
本文介绍了Qt Creator c ++ 11通用项目的语法高亮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的核心问题是,当使用Qt Creator作为通用(非Qt)项目的代码编辑器时,我如何告诉它使用c ++ 11语法高亮? p>

我有一个c ++ 11项目,我一直在工作一段时间,我决定我会尝试Qt Creator。这是一个普通的vanilla c ++项目,有一个手工编码的makefile等。



Qt Creator打开项目(eSLIME)很好,文件:eSLIME.config,eSLIME.includes和eSLIME.files。它没有创建.pro文件。



似乎无法识别c ++ 11调用。例如,它以绿色突出显示 #include< unordered_set> ,表示没有此类文件或目录。



我怀疑我应该把东西放在.config文件,但我不知道什么和谷歌搜索没有帮助。我尝试添加-std = c ++ 0x,但没有工作。



PS:代码太破碎了,现在不能构建,这就是为什么我切换到

解决方案

Qt 5.0.2支持任何c ++文件的c ++ 11语法,然后



只需下载 QT 5.0.2(包含Qt Creator 2.7.0) 。


My core question is, when using Qt Creator as a code editor for "generic" (non-Qt) projects, how do I tell it to use c++11 syntax highlighting?

I have a c++11 project I've been working on for awhile, and I decided I'd give Qt Creator a try. This is a plain vanilla c++ project, with a hand-coded makefile and so forth.

Qt Creator opened up the project ("eSLIME") just fine, and created three files: eSLIME.config, eSLIME.includes and eSLIME.files. It did not create a .pro file.

It seems not to recognize c++11 calls. For example, it underlines "#include <unordered_set>" in green, and indicates that there is no such file or directory.

I suspect I'm supposed to put something in the .config file, but I can't figure out what and google searches aren't helping. I tried appending -std=c++0x, which didn't work.

PS: The code is too broken to build right now, which is why I was switching to an IDE.

解决方案

Qt 5.0.2 support c++11 syntax for any c++ file then

just download QT 5.0.2 ( Qt Creator 2.7.0 included).

这篇关于Qt Creator c ++ 11通用项目的语法高亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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