在 Kubuntu 14.10 上构建 OpenImageIO:出错

Building OpenImageIO on Kubuntu 14.10: make error

Ubuntu 有点新手,这让我很困惑。

目前正在尝试使用 make 构建 OpenImageIO,按照此处概述的步骤操作:https://sites.google.com/site/openimageio/checking-out-and-building-openimageio

据我所知,我已经安装了所有依赖项,但是尝试 运行 make 时出现以下错误:

platform=linux64, hw=x86_64
OPENIMAGEIO_SITE = shanesimmsart-pc
dist_dir = dist/linux64
INSTALLDIR = /home/shanesimmsart/oiio
( cd build/linux64 ; make  )
make[1]: Entering directory `/home/shanesimmsart/oiio/build/linux64'
make[2]: Entering directory `/home/shanesimmsart/oiio/build/linux64'
make[3]: Entering directory `/home/shanesimmsart/oiio/build/linux64'
make[3]: Leaving directory `/home/shanesimmsart/oiio/build/linux64'
make[3]: Entering directory `/home/shanesimmsart/oiio/build/linux64'
[  0%] Building CXX object src/libutil/CMakeFiles/OpenImageIO_Util.dir/strutil.cpp.o
/home/shanesimmsart/oiio/src/libutil/strutil.cpp: In function ‘OpenImageIO::v1_6::string_view OpenImageIO::v1_6::Strutil::parse_nested(OpenImageIO::v1_6::string_view&, bool)’:
/home/shanesimmsart/oiio/src/libutil/strutil.cpp:768:28: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for ( ; nesting && len < p.size(); ++len) {
                            ^
cc1plus: all warnings being treated as errors
make[3]: *** [src/libutil/CMakeFiles/OpenImageIO_Util.dir/strutil.cpp.o] Error 1
make[3]: Leaving directory `/home/shanesimmsart/oiio/build/linux64'
make[2]: *** [src/libutil/CMakeFiles/OpenImageIO_Util.dir/all] Error 2
make[2]: Leaving directory `/home/shanesimmsart/oiio/build/linux64'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/shanesimmsart/oiio/build/linux64'
make: *** [cmake] Error 2

有谁知道我可能做错了什么/可能遗漏了什么?

您使用的软件包默认启用了 -Werror 标志,这会强制编译器将所有警告视为错误。这对于将代码交付给用户来说总是一个坏主意,因为用户会有各种各样不同的编译器和编译器版本,因此用户会收到与开发人员不同的警告。当开发人员构建代码时,他们绝对应该使用 -Werror。当开发人员向用户发送代码时,他们绝对应该默认启用-Werror

无论如何,查看 Git 中的代码,如果您这样做:

make STOP_ON_WARNING=no

它将禁用 -Werror