0

我正在尝试在 windows7 上用 mingw 编译 openexr。我得到这个错误:

main.cpp: In function 'int main(int, char**)':
main.cpp:213:28: error: 'strcmp' was not declared in this scope
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/d/openexr/build/openexr-1.6.1/exrmaketiled'
make: *** [all-recursive] Error 1

为什么我会收到此错误,我该如何解决?

我是 mingw 和 openexr 的新手,所以我可能会做一些傻事!

编辑1:

我正在使用这个脚本来制作它:

!/bin/sh
# modified synfig build file, taken from
# http://www.synfig.org/Windows_build_instructions

echo "Making OpenEXR..."
# Including configuration
if [ -r "./make_openexr.conf" ]; then
  . ./make_openexr.conf
else
echo "No config file (./make_openexr.conf) found."
exit 1
fi

CURRENT_DIR=`pwd`

echo "Cleanup directories"
rm -rf ${BUILD_DIR}/zlib-${ZLIB_VERSION}
[ $? -eq 0 ] || exit 1

rm -rf ${BUILD_DIR}/ilmbase-${ILMBASE_VERSION}
[ $? -eq 0 ] || exit 1

rm -rf ${BUILD_DIR}/openexr-${OPENEXR_VERSION}
[ $? -eq 0 ] || exit 1

echo "Preparing sources"
echo PATH is $PATH
echo tar -xzf ${ZLIB_SRC} -C ${BUILD_DIR}
tar -xzf ${ZLIB_SRC} -C ${BUILD_DIR}
[ $? -eq 0 ] || exit 1
echo tar -xzf ${ILMBASE_SRC} -C ${BUILD_DIR}
tar -xzf ${ILMBASE_SRC} -C ${BUILD_DIR}
[ $? -eq 0 ] || exit 1
echo tar -xzf ${OPENEXR_SRC} -C ${BUILD_DIR}
tar -xzf ${OPENEXR_SRC} -C ${BUILD_DIR}
[ $? -eq 0 ] || exit 1

echo "Configuring zlib"
cd  ${BUILD_DIR}/zlib-${ZLIB_VERSION}
[ $? -eq 0 ] || exit 1
./configure --prefix=${TEMP_INSTALL}
[ $? -eq 0 ] || exit 1

echo "Making"
make
[ $? -eq 0 ] || exit 1
make install
[ $? -eq 0 ] || exit 1
echo "zlib Done"

echo "Applying patches for ILMBase... "
cd  ${BUILD_DIR}/ilmbase-${ILMBASE_VERSION}
[ $? -eq 0 ] || exit 1
for SFILE in ${ILMBASE_PATCHES[@]}
do
  patch -p1 <${PATCHES_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

echo "Configuring ILMbase"
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --prefix=${TEMP_INSTALL} \
  --disable-static --disable-threading --disable-posix-sem
[ $? -eq 0 ] || exit 1

echo "Making"
make
[ $? -eq 0 ] || exit 1
make install
[ $? -eq 0 ] || exit 1
echo "ILMBase Done"

echo "Applying patches for OpenEXR... "
cd  ${BUILD_DIR}/openexr-${OPENEXR_VERSION}
[ $? -eq 0 ] || exit 1
for SFILE in ${OPENEXR_PATCHES[@]}
do
 patch -p1 <${PATCHES_DIR}/${SFILE}
 [ $? -eq 0 ] || exit 1
done

# Now the temp/openexr dir exists, we can add it to paths
if [ -d "${TEMP_INSTALL}" ]; then
 PATH="${TEMP_INSTALL}/bin:${PATH}"
 PKG_CONFIG_PATH="${TEMP_INSTALL}/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

 # set inc/lib path (for zlib)
 CXXFLAGS+=" -I${TEMP_INSTALL}/include"
  LDFLAGS+=" -L${TEMP_INSTALL}/lib"

 export PATH
 export PKG_CONFIG_PATH
 export CXXFLAGS
  export LDFLAGS

  echo "Configuring OpenEXR"
  [ $? -eq 0 ] || exit 1
  ./configure --host=${MINGW_HOST} --prefix=${TEMP_INSTALL} \
  --disable-static --disable-threading --disable-posix-sem  --disable-ilmbasetest
  [ $? -eq 0 ] || exit 1

 echo "separately build b44ExpLogTable as the openexr script doesn't work under msys"
 cd  ${BUILD_DIR}/openexr-${OPENEXR_VERSION}/IlmImf
 [ $? -eq 0 ] || exit 1
 mingw32-g++ --verbose -g -O2 -I${TEMP_INSTALL}/include/OpenEXR -L${TEMP_INSTALL}/lib       b44ExpLogTable.cpp  -lHalf -o b44ExpLogTable
  [ $? -eq 0 ] || exit 1
 cd ..
 [ $? -eq 0 ] || exit 1

 echo "Making"
make
[ $? -eq 0 ] || exit 1
make install
[ $? -eq 0 ] || exit 1
cd ${CURRENT_DIR}
[ $? -eq 0 ] || exit 1
# rm -rf ${BUILD_DIR}/openexr-${OPENEXR_VERSION}
# [ $? -eq 0 ] || exit 1

echo "Done: OpenEXR"

我相信 mingw 和 mysys 的设置不正确,系统找不到包含(和库路径)。我怎样才能检查这个?

4

1 回答 1

0

正如我从源代码文件中注意到的,openexr 应该使用 cmake 工具构建。您必须执行CMake 的步骤

否则只编译g++gcc不工作。

于 2013-03-11T15:29:51.630 回答