Undefined reference to `TDOMParser::TDOMParser()'

Hi,

I am trying to compile g++ files against root. My code is simple and I did
g++ main.cxx root-config --cflags --glibs

#include <TDOMParser.h>

using namespace std;

int main()
{

// gSystem->Load(“libXMLParser.so”);
TDOMParser t;// = new TDOMParser();

return 1;

}

######## errors ####################
main.cxx:(.text+0x8f): undefined reference to TDOMParser::TDOMParser()' main.cxx:(.text+0xa3): undefined reference toTDOMParser::~TDOMParser()’

root-config --cxx --cflags main.cxx root-config --glibs -lXMLParser