Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » libxml2(compile and link libxml2)
libxml2 [message #818514] Sun, 11 March 2012 19:21 Go to next message
ak jax is currently offline ak jaxFriend
Messages: 7
Registered: March 2012
Junior Member
I try to use libxml2 in a C++ project, and I use Eclipse to edit and compile

Running this on the command line
xml2-config --cflags
gives
-I/usr/include/libxml2

Running this on the command line
xml2-config --libs
gives
-lxml2

In ordinary Makefile I should write:

CFLAGS=`xml2-config --cflags`

LIBS=`xml2-config --libs`

In the menu:
Project\settings\Tool Settings\GCC C++ Linker\Miscellaneous\Linker flags
I have enter -lxml2

Where shall I insert following line in eclipse
-I/usr/include/libxml2

It seems that Eclipse cannot found the library

Is there something else I need to do?

[Updated on: Sun, 11 March 2012 19:45]

Report message to a moderator

Re: libxml2 [message #818760 is a reply to message #818514] Mon, 12 March 2012 04:34 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3268
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2012.03.11 13:21, Ake Jacksen wrote:
> I try to use libxml2 c++ project that I use Eclipse to edit and compile
>
> when running the line below on command line:
> xml2-config --cflags
> I get
> -I/usr/include/libxml2
>
>
>
> when running the line below on command line:
> to get the compilation flags and
> xml2-config --libs
> I get:
> -lxml2
>
>
>
> I an ordinary make file I should do following:
>
> CFLAGS=`xml2-config --cflags`
>
> LIBS=`xml2-config --libs`
>
> Project\Settings\Tool Settings\GCC C++ linker\Miscellaneouslinker flags
> I have added
> -lxml2
>
> Where do I put
> -I/usr/include/libxml2
>
> Is it something else i need to do to get this working?

As the sticky posts at the top of this forum say, please ask your C/C++
questions in the Eclipse CDT forum.
Previous Topic:[SOLVED] Content/Code Assist Broken?
Next Topic:Eclipse RCP - How to show web browser preferences in preference dialog if it is not there
Goto Forum:
  


Current Time: Tue Dec 23 00:57:14 GMT 2014

Powered by FUDForum. Page generated in 0.01951 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software