# Revision history [back]

Ok as the title says I have an issue with loading an image and using different CXX_FLAGS in the compiler. In the project that I am working if I set set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") through the cmakelist file and compile the following code: // load original image Mat src = imread("../panther.png"); // check if image is loaded without problems if(!src.data || src.empty()) { cerr << "Problem loading image!" << endl; return -1; } imshow("src", src); Mat3f src_float = src / 255.f; imshow("src_float", src_float);  I will get the following result: However, now if I enable the c++11 or c++1y flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") or set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") the src_float image output changes: why that, does anyone has a clue and how we can prevent this? Thanks. p.s. and yes it is the panther again :-p....  2 retagged pklab 4284 ●7 ●30 ●60 ### strange behaviour with c++0x/c++11/c++1y compiler flags and image showing Ok as the title says I have an issue with loading an image and using different CXX_FLAGS in the compiler. In the project that I am working if I set set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") through the cmakelist file and compile the following code:

// load original image

// check if image is loaded without problems
if(!src.data || src.empty())
{
return -1;
}

imshow("src", src);

Mat3f src_float = src / 255.f;
imshow("src_float", src_float);


I will get the following result:

However, now if I enable the c++11 or c++1y flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") or set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") the src_float image output changes:

why that, does anyone has a clue and how we can prevent this?

Thanks.

p.s. and yes it is the panther again :-p....