Hello. When i try to use testlib with c++11 , arise this error :
In file included from test.cpp:7:0:
testlib.h: In function 'void __testlib_set_binary(FILE*)':
testlib.h:346:20: error: 'fileno' was not declared in this scope
setmode(fileno(file), O_BINARY);
^
Is compatible version released (couldn't find)? or Problem is removable easily ?
Try compiling it with
-std=gnu++11
instead of=std=c++11
.I was always wondering what is the difference between them? And what is the difference between C++0x and C++11?
C++0x is an ancient name for C++11 — it was supposed to be finalized before 2010. This standard is now called C++11, so you'd better use it.
gnu++11
(andgnu++03
as well) enables some GCC extensions to C++. As you can see,fileno
is one of them.thanks a lot :) it works.
I am getting this error no matter what I set std as. :(
Some help please? I use Cygwin on Windows.
I think that the latest testlib from trunk (0.9.9) can be compiled on C++11 without any issues.