minetest / minetestmapper

Generates a overview image of a minetest map.
BSD 2-Clause "Simplified" License
112 stars 40 forks source link

Unable to build with postgresql support. #45

Closed ghost closed 7 years ago

ghost commented 7 years ago

Building MT with postgresql requires a bit of fiddling. Passing the same flags to mtmapper looks promising but fails quickly on make.

leeh@s103139:~/minetestmapper$ cmake . -DENABLE_POSTGRESQL=1 -DPOSTGRESQL_INCLUDE_DIR=/usr/include/postgresql/ -DPOSTGRESQL_LIBRARY=/usr/lib/x86_64-linux-gnu/libpq.so.5.7 -DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql
-- libgd library: /usr/lib/x86_64-linux-gnu/libgd.so
-- libgd headers: /usr/include
-- zlib library: /usr/lib/x86_64-linux-gnu/libz.so
-- zlib headers: /usr/include
-- sqlite3 library: /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- sqlite3 headers: /usr/include
-- PostgreSQL backend enabled
-- PostgreSQL includes: /usr/include/postgresql
-- Configuring done
-- Generating done
-- Build files have been written to: /home/leeh/minetestmapper
leeh@s103139:~/minetestmapper$ make
[ 11%] Building CXX object CMakeFiles/minetestmapper.dir/db-postgresql.cpp.o
/home/leeh/minetestmapper/db-postgresql.cpp: In member function ‘int DBPostgreSQL::pg_to_int(PGresult*, int, int)’:
/home/leeh/minetestmapper/db-postgresql.cpp:151:39: error: ‘atoi’ was not declared in this scope
  return atoi(PQgetvalue(res, row, col));
                                       ^
/home/leeh/minetestmapper/db-postgresql.cpp:152:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
CMakeFiles/minetestmapper.dir/build.make:238: recipe for target 'CMakeFiles/minetestmapper.dir/db-postgresql.cpp.o' failed
make[2]: *** [CMakeFiles/minetestmapper.dir/db-postgresql.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/minetestmapper.dir/all' failed
make[1]: *** [CMakeFiles/minetestmapper.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
sofar commented 7 years ago

try inserting a

#include <stdlib.h>

in the offending cpp file.

ghost commented 7 years ago

@sofar That worked :) I haven't run it yet, but it built. Thanks a ton!

edit: Don't know if this warrants closing this?