Hmm... I now see, why it thinks it is C code. The file to compile is called bob/io/image/pnmio.c. Renaming it to bob/io/image/pnmio.cpp (similar to all the other files inside bob.io.image) should solve the issue.
On Tue, Apr 26, 2016, 5:45 PM Manuel Günther (aka. Gunther, Guenther) <
notifications@github.com> wrote:
Hmm... I now see, why it thinks it is C code. The file to compile is
called bob/io/image/pnmio.c. Renaming it to bob/io/image/pnmio.cpp
(similar to all the other files inside bob.io.image) should solve the
issue.
On Tue, Apr 26, 2016, 5:45 PM Manuel Günther (aka. Gunther, Guenther) <
notifications@github.com> wrote:
Hmm... I now see, why it thinks it is C code. The file to compile is
called bob/io/image/pnmio.c. Renaming it to bob/io/image/pnmio.cpp
(similar to all the other files inside bob.io.image) should solve the
issue.
I see. AFAIR, the problem is that the python compilation always uses the CFLAGS to compile the extensions, not the CPPFLAGS or CXXFLAGS. Hence, in order to be able to use the std-c++11 features, we need to pass this flag to the compilations of the python bindings.
Anyways, you are compiling some C library code into the python Extension. Maybe the solution is to use a Library extension: https://github.com/bioidiap/bob.extension/blob/master/bob/extension/init.py#L448
which compiles the code with CMake, where we can control the flags (although I assume that I might also pass the wrong CFLAGS there, but this can be fixed if needed).
Another solution would be to put the whole pnmio.c into a extern C environment and compile it with the C++ compiler -- i.e., by renaming it to pnmio.cpp.
I think renaming would be the easiest. Please go ahead and rename it.
On Tue, Apr 26, 2016, 7:23 PM Manuel Günther (aka. Gunther, Guenther) <
notifications@github.com> wrote:
I see. AFAIR, the problem is that the python compilation always uses the
CFLAGS to compile the extensions, not the CPPFLAGS or CXXFLAGS. Hence, in
order to be able to use the std-c++11 features, we need to pass this flag
to the compilations of the python bindings.
Anyways, you are compiling some C library code into the python Extension.
Maybe the solution is to use a Library extension:
https://github.com/bioidiap/bob.extension/blob/master/bob/extension/init.py#L448
which compiles the code with CMake, where we can control the flags
(although I assume that I might also pass the wrong CFLAGS there, but
this can be fixed if needed).
Another solution would be to put the whole pnmio.c into a extern C
environment and compile it with the C++ compiler -- i.e., by renaming it to
pnmio.cpp.