Opened 7 years ago

Closed 7 years ago

#4462 closed defect (fixed)

Missing g++ erroneously indicates that zlib is not found

Reported by: middleforkgis Owned by: jburgess777@…
Priority: minor Milestone:
Component: osm2pgsql Version:
Keywords: configure, zlib, g++ Cc:

Description

osm2pgsql SVN version 0.80.0 (64bit id space)

Various commenters (see for example #3505) have noted a failure to configure osm2pgsql, wherein the following error is displayed:

checking for xml2 libraries... yes
checking for zlib headers in /usr/include... not found
checking for zlib compression library... no
configure: error: required library not found

I have experienced the same [Debian, Wheezy AMD64] I believe I have isolated the problem.

Here is the proof that zlib.h is present:

root@ip-10-252-70-252:~/osm2pgsql# dpkg -L zlib1g-dev |grep zlib.h
/usr/include/zlib.h

Here is the relevant error in config.log:

configure:4327: checking for C++ compiler version
configure:4336: g++ --version >&5
./configure: line 4338: g++: command not found
configure:4347: $? = 127
configure:4336: g++ -v >&5
./configure: line 4338: g++: command not found
configure:4347: $? = 127
configure:4336: g++ -V >&5
./configure: line 4338: g++: command not found
configure:4347: $? = 127
configure:4336: g++ -qversion >&5
./configure: line 4338: g++: command not found
configure:4347: $? = 127
configure:4351: checking whether we are using the GNU C++ compiler
configure:4370: g++ -c   conftest.cpp >&5
./configure: line 1634: g++: command not found
configure:4370: $? = 127

So I install g++

apt-get install g++

Re-run configure

checking for xml2 libraries... yes
checking for zlib headers in /usr/include... found
checking for zlib library... found
checking for zlib compression library... yes

Configure concludes successfully as does make.

Conclusion: missing g++ erroneously indicates missing zlib.

Requested fix: test for g++ before testing for zlib and throw an error if g++ is not found.

Change History (2)

comment:1 Changed 7 years ago by middleforkgis

Milestone: OSM 0.8

comment:2 Changed 7 years ago by amm

Resolution: fixed
Status: newclosed

The configure script should now fail if no c++ compiler was found.

Note: See TracTickets for help on using tickets.