mapnik / mapnik-support

Use the issues queue here to ask questions and offer help on using Mapnik (maybe if this works well we can retire the mailing list at http://mapnik.org/contact/?)
6 stars 6 forks source link

[ERROR] "use of undeclared identifier 'sqlite3_enable_load_extension'" while installation #119

Open Fa7C0n opened 5 years ago

Fa7C0n commented 5 years ago

I was trying to install mapnik in macOS mojave from source by following the instruction from wiki page. I am getting the following Error while running the make command

plugins/input/sqlite/sqlite_connection.hpp:171:9: error: use of undeclared identifier 'sqlite3_enable_load_extension'
        sqlite3_enable_load_extension(db_, 1);
        ^
plugins/input/sqlite/sqlite_connection.hpp:172:22: error: use of undeclared identifier 'sqlite3_load_extension'
        int result = sqlite3_load_extension(db_, ext_path.c_str(), 0 , 0);
                     ^
2 errors generated.
scons: *** [plugins/input/sqlite/sqlite_datasource.os] Error 1
scons: building terminated because of errors.
make: *** [mapnik] Error 2 

I checked for sqlite3 and it is installed and up to date. Can someone help me?

Thank you 🙇

alspringsteen commented 5 years ago

I had the same error. This was helpful to read: https://github.com/valhalla/valhalla/issues/1123.

It basically says that the default install of sqlite3 on a Mac does not export the enable extension functions. That is why the error is popping up. It literally cannot find those functions.

I had installed sqlite3 from Homebrew, and it didn't seem like it was using functions from that install.

I also followed the instructions from the wiki page, but modified them to address the issues with sqlite3:

git clone https://github.com/mapnik/mapnik.git git submodule update --init export PATH="/usr/local/opt/sqlite/bin:$PATH" ./configure CUSTOM_CXXFLAGS="-I/usr/local/opt/sqlite/include" CUSTOM_LDFLAGS="-L/usr/local/opt/sqlite/lib" make make install

You could also add that export PATH line to your ~/.bash_profile

I haven't given this a full test yet, but maybe it will work or get you halfway there.

I'm not sure if you use Homebrew, but it looks like there may also be a way to install Mapnik that way, with some additional config options: Mapnik Homebrew

ngenovictor commented 4 years ago

I am also getting the same error. I guess the instructions above are

git clone https://github.com/mapnik/mapnik.git 
git submodule update --init 
export PATH="/usr/local/opt/sqlite/bin:$PATH" 
./configure 
CUSTOM_CXXFLAGS="-I/usr/local/opt/sqlite/include" 
CUSTOM_LDFLAGS="-L/usr/local/opt/sqlite/lib" 
make 
make install
ngenovictor commented 4 years ago

I think https://github.com/mapnik/mapnik/issues/4051 solves the issue. Solved mine.

snickell commented 4 years ago

Configuring with: ./configure SQLITE_INCLUDES=/usr/local/opt/sqlite3/include

Fixes the issue on OSX, but it'd be nice to get a fix that defaults to using the homebrew sqlite on OSX if the system one fails?

snickell commented 4 years ago

Or an update to INSTALL.md that documents this command on OSX+homebrew.