gpt4 book ai didi

c++ - 如何使用 mingw 编译 openexr

转载 作者:行者123 更新时间:2023-11-30 17:53:57 25 4
gpt4 key购买 nike

我正在尝试在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 的设置不正确,系统找不到包含(和库路径)。我怎样才能检查这个?

最佳答案

正如我从 source code files 中注意到的那样,openexr 应该使用 cmake 工具构建。你必须做steps CMake 的。

否则仅通过 g++gcc 编译将无法工作。

关于c++ - 如何使用 mingw 编译 openexr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15342049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com