[英]Tuple not recognized by Clion
CLion doesn't seem to recognize c++ tuple
s, although I can build and run my program from the terminal. 尽管我可以从终端构建和运行程序,但CLion似乎无法识别c ++ tuple
。
When trying to build, I only get "Build failed", while all the members of tuple
are highlighted and I'm getting "Can't resolve namespace member tuple" (same with tie
and make_tuple
). 尝试构建时,我只会得到“ Build failed”,而tuple
所有成员都将突出显示,而我却得到“无法解析名称空间成员元组”(与tie
和make_tuple
相同)。
Here is my simple test: 这是我的简单测试:
#include<iostream>
#include<tuple>
std::tuple<int,int> testTuple();
int main(int argc, char** argv) {
int a, b;
std::tie(a,b) = testTuple();
std::cout<<a<<" "<<b;
return 0;
}
std::tuple<int,int> testTuple()
{
return std::make_tuple(0,1);
}
My CMakeLists.txt
: 我的CMakeLists.txt
:
cmake_minimum_required(VERSION 2.8)
project(testTuple)
SET(CMAKE_CXX_COMPILER, /usr/bin/g++-4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_BUILD_TYPE Debug)
set(SOURCE_FILES "src/main.cpp")
add_executable(simplification ${SOURCE_FILES})
For implementing such features as code-competition, jump to definitions and so on features CLion
has it's own c++
parser. 为了实现诸如代码竞争,跳转到定义等功能, CLion
拥有自己的c++
解析器。 So if your code compiled, but CLion
show some kind of errors, go and report bug to jetbrain ( https://youtrack.jetbrains.com/issues/CPP ) 因此,如果您的代码已编译,但CLion
显示了某种错误,请向Bugbrain报告错误( https://youtrack.jetbrains.com/issues/CPP )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.