gstf / libspatialite-ios

libspatialite compiled for iOS
55 stars 48 forks source link

libxml2 missing #7

Closed ghost closed 9 years ago

ghost commented 9 years ago

Thanks for putting this together...but when running make I get the following:

configure: error: 'libxml2' is required but it doesn't seem to be installed on this system. make[1]: * [/Users/lz/OpenSource/libspatialite-ios/build/armv7/lib/libspatialite.a] Error 1 make: * [build_arches] Error 2

muellermartin commented 9 years ago

If you have Homebrew installed try

brew install libxml2
DennisZP commented 9 years ago

run "brew install libxml2" after,How should I do,Could you give a detailed process! Thanks so much!

muellermartin commented 9 years ago

@DennisZP By

run "brew install libxml2"

I meant libxml2 is probably missing in the compiler's library search directories (issued with -L flag). It is up to you on how you install it, although it should already be installed as Framework though…

A possible solution could be to just install it via a package manager (the most popular on Mac OS are Homebrew and MacPorts). You might already have one of these installed, then you just have to look up the name of the package (e.g. libxml2) and install it. For Homebrew the command looks like brew install libxml2.

Please report back if this fixes the issue.

ghost commented 9 years ago

No, it didn't work for me. I did the brew install and built from source. I was going to figure where to change the compiler or configure search path but got side tracked.

muellermartin commented 9 years ago

@lzumbach Could you please post the output of following command:

ls -l $(xcode-select --print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libxml2*

ghost commented 9 years ago

Here is the output from ls -l $(xcode-select --print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libxml2*

-rwxr-xr-x 1 root wheel 352496 Mar 31 15:52 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libxml2.2.dylib lrwxr-xr-x 1 root wheel 15 Mar 9 18:15 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libxml2.dylib -> libxml2.2.dylib

muellermartin commented 9 years ago

@lzumbach Thanks! It seems libxml2 is also available for the target platform. Did you try a clean build by updating the Make file via git pull and running make clean before building again with make?

ghost commented 9 years ago

Just make clean, pulled, and make.... and still the same issue. Weird.
configure: error: 'libxml2' is required but it doesn't seem to be installed on this system. make[1]: * [/Users/lylezumbach/OpenSource/libspatialite-ios/build/armv7/lib/libspatialite.a] Error 1 make: * [build_arches] Error 2

One thing I forgot to mention too was that on my personal Macbook Pro at home the build had worked fine. I am not sure what the difference is between the two machines. The one at home is a year older.

Also, at some point...I wouldn't mind seeing a simple sample swift program and simple instructions on pulling the library into XCode, setting up a bridging header, build, etc.

Thanks!

muellermartin commented 9 years ago

I assume the error you get occurs in the configure step triggered by line 56 in the Makefile which seems to fail while checking for libxml2.

Maybe the configure script relies on pkg-config to search for the lib. You could check if you have installed it via brew install pkg-config and report back…

Also, at some point...I wouldn't mind seeing a simple sample swift program and simple instructions on pulling the library into XCode, setting up a bridging header, build, etc.

Sorry, I guess I'm the wrong person for that ;) But of course examples are always useful. Maybe someone else will contribute them…

ghost commented 9 years ago

brew didn't work on this so I installed pkg-config from source and then it built:

Check for pkg-config via $ which pkg-config, if not found you will want to install it:

$ curl http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz -o pkgconfig.tgz $ tar -zxf pkgconfig.tgz && cd pkg-config-0.28 $ ./configure && make install If you run into an error like the following:

configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy. run ./configure --with-internal-glib run sudo make install

muellermartin commented 9 years ago

@lzumbach Did you get the configure error for libspatialite-ios or pkg-config? And does having pkg-config installed resolve the libxml2 issue?

ghost commented 9 years ago

The configure error was with pkg-config. Yes, it resolved the libxml2 issue. Sorry, I wasn't clear.

muellermartin commented 9 years ago

@lzumbach Thanks for clarifing! I'll consider this issue as fixed then.