OpenImageIO/oiio — Issue #206: Error compiling master branch
Author: HughMacdonald
Created: 2012-01-05 18:53:05+00:00
State: open

Hi,

I'm just trying to get OIIO to compile - this is on Linux (Ubuntu), with the current master branch of the repository.

[ 80%] Building CXX object libOpenImageIO/CMakeFiles/optparser_test.dir/optparser_test.cpp.o
In file included from /mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/libOpenImageIO/optparser_test.cpp:39:
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h: In function ‘bool OpenImageIO::v0_11::optparse1(C&, const std::string&)’:
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h:69: error: there are no arguments to ‘strchr’ that depend on a template parameter, so a declaration of ‘strchr’ must be available
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h:69: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h: In function ‘bool OpenImageIO::v0_11::optparse1(C&, const std::string&) [with C = MySystem]’:
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h:118: instantiated from ‘bool OpenImageIO::v0_11::optparser(C&, const std::string&) [with C = MySystem]’
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/libOpenImageIO/optparser_test.cpp:84: instantiated from here
/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/src/include/optparser.h:69: error: ‘strchr’ was not declared in this scope
make[3]: *** [libOpenImageIO/CMakeFiles/optparser_test.dir/optparser_test.cpp.o] Error 1
make[3]: Leaving directory `/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/build/linux64'
make[2]: *** [libOpenImageIO/CMakeFiles/optparser_test.dir/all] Error 2
make[2]: Leaving directory `/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/build/linux64'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mount/nvizible_users/hughmacdonald/development/OpenIO/Image/ocio/build/linux64'
make: *** [cmake] Error 2

In optparser_test.cpp, replacing this:

#include

with

#include

seems to fix it.

I can submit a pull request for this fix, if people consider it appropriate...?