0

I was using CImg for picture processing, which don't compile for C++11 or above:

CImg.h:48902:22: error: there are no arguments to 'pclose' that depend on a template parameter, so a declaration of 'pclose' must be available [-fpermissive]

But my program which includes CImg.h does use some C++11 feature. Can I use different C++ standard to process these two files? CImg.h itself is a header+code so I have to #include that.

Here is my test program:

#define cimg_display 0
#include "CImg.h"
int main(){}

CImg.h comes from the lastest version from http://cimg.eu/.

ZisIsNotZis
  • 1,570
  • 1
  • 13
  • 30
  • `pclose` is a POSIX function (or maybe it's from somewhere else entirely and has the same name) and is not part of C++. More information is required to give assistance. – user4581301 Jan 27 '17 at 00:43
  • I'm under Cygwin. The compilation do passes without `-std=c++11` – ZisIsNotZis Jan 27 '17 at 00:45
  • @ZisIsNotZis It's likely that using -std with any main C++ standard would give that result, Clang and GCC will be restrictive about what non-standard functions they allow when you explicitly specify a standard. For GCC, `-std=gnu++11` might work, but even if it does I believe there should be a better way of specifying it. – JAB Jan 27 '17 at 00:52
  • You refer to 2 files but only show one - where is the other one? What command do you use to compile? – Mark Setchell Jan 30 '17 at 23:24

0 Answers0