[xml] Compilation errors



Hi,
Is there any other way of compiling these file other than the below option?
 gcc `xml2-config --cflags --libs` -o tree2 tree2.c

I tried giving in my Makefile,

CFLAGS := -c -g `xml2-config --cflags --libs` -Wno-write-strings -fomit-frame-pointer -I$(inc_dir) -I$(os_inc_dir) -L$(lib_dir) $(ext_dir) `xml2-config --cflags --libs` -D_LNX -D_LNX32 -DNDEBUG -D_LNX2 -D_SMP=1 -D_OS=LNX

And compiling as below,

$(obj_dir)/XMLFILE.o : $(src_dir)/XMLFILE.cpp
        $(cc) $(CFLAGS) -o $@ $(src_dir)/XMLFILE.cpp


I get error as undefined reference for all the API's that i use in my application. But when i use like,gcc `xml2-config --cflags --libs` -o tree2 tree2.c it works fine.
/home/sam/xml_examples/tree2.c:77: undefined reference to `xmlAddChild'
/home/sam/xml_examples/tree2.c:84: undefined reference to `xmlNewChild'
/home/sam/xml_examples/tree2.c:85: undefined reference to `xmlNewText'
/home/sam/xml_examples/tree2.c:88: undefined reference to `xmlAddChild'
/home/sam/xml_examples/tree2.c:89: undefined reference to `xmlAddChild'

Any Reason???



Regards,
Sam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]