I try to parse some xml file by Xerces C++ 3.1.1 in NetBeans 6.9.1. (with MinGW) but the compiler can not build the project. The source pasted from the Xerces documentation. The Xerces bin path included to the enviroment path variable and the Xerces include path included to the source folders of the project.
Here is the code snippet:
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOM.hpp>
using namespace xercesc;
int main(int argc, char** argv)
{
try
{
XMLPlatformUtils::Initialize();
XMLCh name[101];
XMLString::transcode( "test", name, 100 );
DOMImplementation *imp = DOMImplementationRegistry::getDOMImplementation( name );
XMLString::transcode( "root", name, 100 );
XMLPlatformUtils::Terminate();
}
catch ( const XMLException &e )
{
return 1;
}
return 0;
}
Here I pasted the compiler output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: Entering directory `/e/zsolt/NetBeans/Test' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_Qt-Windows/test.exe make[2]: Entering directory `/e/zsolt/NetBeans/Test' mkdir -p dist/Debug/MinGW_Qt-Windows g++.exe -o dist/Debug/MinGW_Qt-Windows/test build/Debug/MinGW_Qt-Windows/main.o build/Debug/MinGW_Qt-Windows/main.o: In function `main': E:\zsolt\NetBeans\Test/main.cpp:24: undefined reference to `_imp___ZN11xercesc_3_16XMLUni22fgXercescDefaultLocaleE' E:\zsolt\NetBeans\Test/main.cpp:24: undefined reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils10InitializeEPKcS2_PNS_12PanicHandlerEPNS_13MemoryManagerE' E:\zsolt\NetBeans\Test/main.cpp:26: undefined reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE' E:\zsolt\NetBeans\Test/main.cpp:26: undefined reference to `_imp___ZN11xercesc_3_19XMLString9transcodeEPKcPtmPNS_13MemoryManagerE' E:\zsolt\NetBeans\Test/main.cpp:27: undefined reference to `_imp___ZN11xercesc_3_125DOMImplementationRegistry20getDOMImplementationEPKt' E:\zsolt\NetBeans\Test/main.cpp:28: undefined reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE' E:\zsolt\NetBeans\Test/main.cpp:28: undefined reference to `_imp___ZN11xercesc_3_19XMLString9transcodeEPKcPtmPNS_13MemoryManagerE' E:\zsolt\NetBeans\Test/main.cpp:32: undefined reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils9TerminateEv' collect2: ld returned 1 exit status make[2]: *** [dist/Debug/MinGW_Qt-Windows/test.exe] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 make[2]: Leaving directory `/e/zsolt/NetBeans/Test' make[1]: Leaving directory `/e/zsolt/NetBeans/Test' BUILD FAILED (exit value 2, total time: 1s)
Can anybody help me the settings of NetBeans to resolve the problems?
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 05 February 2011 - 04:39 AM

New Topic/Question
Reply




MultiQuote





|