dreamstreat / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

Compiling parsekml.cc (QuickStart) #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When compiling the parsekml.cc example from QuickStart page using 'g++ 
parsekml.cc' I get the following error:

parsekml.cc:(.text+0xb4): undefined reference to `kmldom::Parse
(std::basic_string<char, std::char_traits<char>, std::allocator<char> > 
const&, std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >*)'
...
...

What's going wrong? 'make install' finished without errors.

Original issue reported on code.google.com by thimmek...@gmail.com on 19 May 2009 at 12:08

GoogleCodeExporter commented 8 years ago
if you build like this:

sh autoconf.sh
mkdir build
cd build
../configure
make

... then parsekml is here

examples/helloworld/parsekml

This builds the binary against the libraries elsewhere
within the build area

To build parsekml.cc outside of the libkml sources
you need to create a proper Makefile for it referring
to the location(s) where you've installed the headers
and libraries.  If the default location is used then that
makefile would like about like this:

parsekml: parsekml.cc
    g++ -o $@ $< -I/usr/local/include -L/usr/local/lib -lkmldom -lkmlbase -lexpat

Original comment by bent.hag...@gmail.com on 20 May 2009 at 6:57

GoogleCodeExporter commented 8 years ago
There's no bug here.  This is perhaps an enhancement request to supply
a Makefile which can build the examples using installed headers, libraries
as opposed to the current Makefile.am which builds examples using
the build area headers/libraries.  Marking that a very low priority
enhancement (the Makefile will either be too simple -- assume
the default locations or as complex as a Makefile.am -- permit
abitrary header and library)

Original comment by kml.b...@gmail.com on 20 May 2009 at 7:00

GoogleCodeExporter commented 8 years ago
Thanks. I used only
g++ -I/usr/local/include -L/usr/local/lib parsekml.cc
With -lkmldom -lkmlbase options it works.

Original comment by thimmek...@gmail.com on 26 May 2009 at 3:01