Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build with postgresql support. #45

Closed
ghost opened this issue Mar 13, 2017 · 2 comments
Closed

Unable to build with postgresql support. #45

ghost opened this issue Mar 13, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2017

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
Copy link

sofar commented Mar 13, 2017

try inserting a

#include <stdlib.h>

in the offending cpp file.

@ghost
Copy link
Author

ghost commented Mar 14, 2017

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

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

@sfan5 sfan5 closed this as completed in 4f7d2a5 Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant