From: Philipp K. K. <pk...@sp...> - 2006-06-03 09:19:26
|
tikcireviva wrote: > Hi Guys, > > I can build the libxml++ with MinGW successfully, however when I try to > compile a simple program, > > g++ -o test.exe -O2 test.cpp -Lc:/mingw-5.0.2/include > > #include <libxml++/libxml++.h> > int main() > { > xmlpp::DomParser parser; > return 0; > } > > it prompts the error like this, > > $ g++ -o test.exe -O2 test.cpp -Lc:/mingw-5.0.2/include > C:/DOCUME~1/LOCALS~1/Temp/1/ccuwcaaa.o(.text+0x21):test.cpp: undefined > reference to `_imp___ZN5xmlpp9DomParserC1Ev' > C:/DOCUME~1/LOCALS~1/Temp/1/ccuwcaaa.o(.text+0x29):test.cpp: undefined > reference to `xmlpp::DomParser::~DomParser()' > collect2: ld returned 1 exit status > > So weird, do you guys know why is that? Am I doingthe libxml++ > compilation in a wrong way? It looks as if you forgot to specify that libxml++ should be used by the linker. ~> g++ -o test.exe -O2 -lxmlpp test.cpp -Lc:/mingw-5.0.2/include (assuming that you copied the libxml++ binaries you created into you library folder or they're in your library search path for some other reason). Philipp |