在Kubuntu 14.10上构建OpenImageIO:出错

时间:2015-02-22 15:48:37

标签: linux ubuntu boost build makefile

这里有一个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

有没有人知道我可能做错了什么/可能会丢失?

1 个答案:

答案 0 :(得分:1)

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

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

make STOP_ON_WARNING=no

它会停用-Werror