jww
jww

Reputation: 102426

zlib, harsh compiler warnings and configure test

I'm trying to compile zlib from the command line, and I'm getting this message when using -Wall -Wextra -Wconversion (full cross-compile script is below):

Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).

Here's the configure test that's generating the line:

cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
  :
else
  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  leave 1
fi

Its not clear to me what exactly is being judged too harsh (especially since -Werror is not present). I also don't quite understand what the sample program used in the test is doing, so its not clear to me what the criteria is for judging the compiler warnings "too harsh".

What is zlib complaining is too harsh?


#! /bin/sh

export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"

export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
export LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
export AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
export RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib

export CFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdks""
export CXXFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk""

Upvotes: 10

Views: 13794

Answers (4)

Joao Rodrigues
Joao Rodrigues

Reputation: 1

is a old question, but i just had this problem compiling zlib 1.2.11 and to bypass this needed to force sudo previous to configure

sudo ./configure --prefix=path

Upvotes: 0

Alberto Chiusole
Alberto Chiusole

Reputation: 2804

My problem was:
cc1: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

Search for details in configure.log.

Upvotes: 1

cnd
cnd

Reputation: 1731

mine was failing because it tried to use cc (non existent) instead of gcc

Upvotes: 0

Eric Reichwaldt
Eric Reichwaldt

Reputation: 181

I had the exact same problem on a newly built machine, and I found the cause was that I didn't actually have the appropriate GNU C compilers installed (reference). Therefore it's complaining that the compiler is too harsh simply because there is no compiler.

Try running:

sudo apt-get install build-essential

and then try running your ./configure again.

Upvotes: 16

Related Questions