From owner-freebsd-questions@FreeBSD.ORG Mon Nov 14 03:44:18 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B9C216A41F for ; Mon, 14 Nov 2005 03:44:18 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D90543D45 for ; Mon, 14 Nov 2005 03:44:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (adsl-66-124-231-46.dsl.snfc21.pacbell.net [66.124.231.46]) (authenticated bits=0) by igloo.linux.gr (8.13.4/8.13.4/Debian-3) with ESMTP id jAE3htp2004351; Mon, 14 Nov 2005 05:44:03 +0200 Received: by flame.pc (Postfix, from userid 1001) id 81B1A116DD; Sun, 13 Nov 2005 19:43:42 -0800 (PST) Date: Sun, 13 Nov 2005 19:43:42 -0800 From: Giorgos Keramidas To: Marc Argent Message-ID: <20051114034342.GB6650@flame.pc> References: <4d6854f30511131644p52847154o@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d6854f30511131644p52847154o@mail.gmail.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.627, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.77, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD 6.0 and Objective C X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2005 03:44:18 -0000 On 2005-11-14 00:44, Marc Argent wrote: > Hi, > > I am trying to compile a very simple Objective C program (actually, it > is a 'Hello World' test program with a different file extension and > linked to the Objective C library). > > #import > > int main (int argc, const char *argv[]) > { > printf("Hello World\n"); > return 0; > } > > I am invoking the compiler with the following line: > > gcc main.m -o helloworld -l objc > > This results in the following error message: > > /usr/lib/libobjc.so: undefined reference to `pthread_attr_destroy' > /usr/lib/libobjc.so: undefined reference to `pthread_create' > /usr/lib/libobjc.so: undefined reference to `pthread_attr_init' > /usr/lib/libobjc.so: undefined reference to `pthread_exit' > /usr/lib/libobjc.so: undefined reference to `pthread_getschedparam' > /usr/lib/libobjc.so: undefined reference to `pthread_setschedparam' > /usr/lib/libobjc.so: undefined reference to `pthread_attr_setdetachstate' First of all, remove the space after -l. Then add -lpthread to the libraries you link to and see if that helps.