0

I am trying to compile openexr with mingw on windows7. I am gettng this error:

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

Why am I getting this error and how can I slove it?

I am new in mingw and openexr, so I may did something silly!

edit1:

I am using this script to make it:

!/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"

I belive the setup for mingw and mysys is not correct and the system can not find the include (and librry path). How can I check this?

mans
  • 17,104
  • 45
  • 172
  • 321

1 Answers1

0

As I noticed from the source code files, openexr should build with cmake tool. You have to do steps of CMake.

Otherwise compile just by g++ or gcc doesn't work.

masoud
  • 55,379
  • 16
  • 141
  • 208