Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 2.6.0, Qt Creator 2.7.0, Qt Creator 2.8.0-beta
-
None
-
Ubuntu 12.10
Description
With the following CMakeLists.txt
-------------------------------
cmake_minimum_required(VERSION 2.6)
project(Test)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYTEST")
add_executable(Test main.cpp)
-------------------------------
and this code:
-------------------------------
#include <iostream>
int main()
{ #ifdef MYTEST std::cout << "MYTEST" << std::endl; #else std::cout << "NOT MYTEST" << std::endl; #endif }-------------------------------
The output is:
MYTEST
indicating that the flag/definition MYTEST was set correctly. However, the highlighter shows this line as gray:
std::cout << "MYTEST" << std::endl;
indicating it thinks that MYTEST is not defined. This is very confusing.