SoloCodigo

Programación General => C/C++ => Mensaje iniciado por: AnioN en Domingo 8 de Abril de 2007, 23:42

Título: C Compiler: Cc -lpthread Pthread1.c
Publicado por: AnioN en Domingo 8 de Abril de 2007, 23:42
Hola, no entiendo muy bien que hace "C compiler: cc -lpthread  pthread1.c", cuando se usa el parametro -l
Título: Re: C Compiler: Cc -lpthread Pthread1.c
Publicado por: su - en Lunes 9 de Abril de 2007, 00:04
rtfm.  :P

Citar
-l library
Search the library named library when linking. (The second alternative with the library as separate argument is only for POSIX compliance and is not recommended.)

It makes a difference where in the command you write option; te linker searches and process libraries and object files in the oreder they are specified....
Esta como en la linea 5683 del manual de GCC (man gcc).
 :hola:
Título: Re: C Compiler: Cc -lpthread Pthread1.c
Publicado por: AnioN en Lunes 9 de Abril de 2007, 00:47
claro, pero no siempre se usa. En este caso porque estoy haciendo una aplicacion multitreads. Cuando tengo que especificar la libreria que se tiene que usar?
Título: Re: C Compiler: Cc -lpthread Pthread1.c
Publicado por: su - en Lunes 9 de Abril de 2007, 01:19
Yo siempre lo he visto asi... cuando se una una libreria siempre hay que decirle que la busque (ejm. gtk, X11...)

Aunque realmente no me preocupo por eso.