Re: [xml] Compilation errors



I think you may find better help if you find someone near you that knows C to help you as you get started learning the language and its tools.

This list isn't exactly the place for basic help using a C compiler, though I'm sure there are some lists out there for that topic but this one isn't it.

This one is for the discussion of libxml2 and its generally considered that you have a good command of the C language and its tools when posting here.

I don't intend to be mean, but you aren't going to find much help of the kind you need on this list.  Another good start might be to google for the common part of the error messages, for instance, try this link: http://www.lmgtfy.com/?q=%3A+undefined+reference+to

On Oct 20, 2010, at 3:50 PM, samaram s wrote:

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

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml



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