Article View: es.comp.os.linux.programacion
Article #7116Re: Problemas al linkar librerias de POSIX threads
From: Frank Poole
Date: Mon, 31 Mar 2003 13:32
Date: Mon, 31 Mar 2003 13:32
17 lines
1760 bytes
1760 bytes
Angel Ivan Castell Rovira <al004140@alumail.uji.es> - Mon, 31 Mar 2003 09:45:48 +0000 (UTC): > El programa anterior lo compilo de la siguiente forma: > > $ gcc ej.thread.c > > y este es el error que obtengo por la pantalla > > /tmp/ccegkcVY.o: In function `main': > /tmp/ccegkcVY.o(.text+0x54): undefined reference to `pthread_create' > /tmp/ccegkcVY.o(.text+0x6b): undefined reference to `pthread_create' > collect2: ld returned 1 exit status Lo que pasa es que te falta decirle al gcc que enlace con la biblioteca pthread con el parametro -lpthread. Una vez compilado veras que no funciona como esperas, la pista estΓ‘ en que te has liado con los punteros.
Technical Details
Message-ID:
<b69g0u$2vvgs$1@ID-176895.news.dfncis.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!151.189.0.75.MISMATCH!newsfeed.arcor-online.net!fu-berlin.de!uni-berlin.de!cmr-213-141-33-214.telecable.ES!not-for-mailReferences:
<b692oc$kjd$1@sofora01.uji.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,13e054c8d212500c X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2003-03-31 05:32:22 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!151.189.0.75.MISMATCH!newsfeed.arcor-online.net!fu-berlin.de!uni-berlin.de!cmr-213-141-33-214.telecable.ES!not-for-mail From: Frank Poole <frankpoole @ eresmas . com> Newsgroups: es.comp.os.linux.programacion Subject: Re: Problemas al linkar librerias de POSIX threads Date: 31 Mar 2003 13:32:20 GMT Lines: 17 Message-ID: <b69g0u$2vvgs$1@ID-176895.news.dfncis.de> References: <b692oc$kjd$1@sofora01.uji.es> NNTP-Posting-Host: cmr-213-141-33-214.telecable.es (213.141.33.214) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1049117540 3145244 213.141.33.214 (16 [176895]) X-Newsreader: Sylpheed version 0.8.11 (GTK+ 1.2.10; i686-pc-linux-gnu)