does anybony compiled successfully the Maxmind C library on Visual Studio 2010? I’m not able to compile it on Windows because I get a lot of errors regarding files not found like unistd.h
does anybony compiled successfully the Maxmind C library on Visual Studio 2010? I’m not
Share
The error that you are seeing is probably because you are including GeoIPUpdate which isn’t really necessary. GeoIPUpdate is a standalone script for updating the databases, and isn’t necessary to use the APIs themselves. Try removing that to see if that resolves your issues.
Additionally, to get version 1.4.8 to compile for me on Visual Studio 2005 I had to do the following additional steps:
#define ssize_t longPACKAGE_VERSIONto “1.4.8”static constwhen declaring an array. Change the definition oftmp_fixed_recordto beunsigned char tmp_fixed_record[6+4]; //Can't use CITYCONFIDENCEDIST_FIXED_RECORD in declarationtat the start of_extract_record().Now, in Visual Studio go to Project->Properties->Linker->Input and under “Additional Dependencies” add “ws2_32.lib zlibwapi.lib zlibstat.lib”. Next, Under Linker->General go to
“Additional Library Dependencies” and add the location of where you saved the files above.
preadis undefined. Add the following definition to each of these files:Additionally, add
#include <io.h>to GeoIP.h so that_lseekand_readare included.