Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C Programming Language

How to link libxml when compiling?


I have this error message when compiling mx_init.c by linking libxml
library as follow:

gcc `xml2-config --cflags` -c mx_init.c `xml2-config --libs` -g -Wall
gcc: -lxml2: linker input file unused because linking not done
gcc: -lz: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done

How can I fix this error?
Thank you in advance.

Jimin Lee

In article <1180379776.086110.307@p77g2000hsh.googlegroups.com>,

geoplab  <geop@gmail.com> wrote:
>I have this error message when compiling mx_init.c by linking libxml
>library as follow:
>gcc `xml2-config --cflags` -c mx_init.c `xml2-config --libs` -g -Wall
>gcc: -lxml2: linker input file unused because linking not done
>gcc: -lz: linker input file unused because linking not done
>gcc: -lpthread: linker input file unused because linking not done
>gcc: -lm: linker input file unused because linking not done
>How can I fix this error?

gcc and libraries are not really on topic in comp.lang.c, which
deals with the C language rather than with the specifics of
any implementation.

<OT>
Read the output. The libraries were not used because linking
was not done. Why was linking not done? Because you told it not
to link.

$ man gcc
       -c  Compile or assemble the source files, but do not link.  The link-
           ing stage simply is not done.
--
   I was very young in those days, but I was also rather dim.
   -- Christopher Priest

geoplab wrote:
> I have this error message when compiling mx_init.c by linking libxml
> library as follow:

> gcc `xml2-config --cflags` -c mx_init.c `xml2-config --libs` -g -Wall
> gcc: -lxml2: linker input file unused because linking not done
> gcc: -lz: linker input file unused because linking not done
> gcc: -lpthread: linker input file unused because linking not done
> gcc: -lm: linker input file unused because linking not done

> How can I fix this error?

This is compiler-specific, so really doesn't belong in comp.lang.c.  A
gcc newsgroup or mailing list might have been a better choice.  An even
better choice is to check your documentation, where you would find that
the "-c" flag tells the compiler not to link or produce an executable.
Since it refuses to do what you told it not to do, there is no error.
Here's a hint: when an application does what you tell it to, and you
don't like the result, then you probably told it the wrong thing to do.

> Thank you in advance.

Bite me.

geoplab wrote:

> I have this error message when compiling mx_init.c by linking libxml
> library as follow:

> gcc `xml2-config --cflags` -c mx_init.c `xml2-config --libs` -g -Wall
... snip ...

> How can I fix this error?

The -c parameter says to compile to object file only, do not link.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc