From owner-freebsd-questions@FreeBSD.ORG Sun Feb 26 00:03:32 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13C01065670 for ; Sun, 26 Feb 2012 00:03:32 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 39F818FC15 for ; Sun, 26 Feb 2012 00:03:31 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBFBA7.dip.t-dialin.net [93.203.251.167]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id q1Q03TrG094075; Sun, 26 Feb 2012 00:03:30 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id q1Q03Iaw080906; Sun, 26 Feb 2012 01:03:18 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id q1Q035OW083472; Sun, 26 Feb 2012 01:03:11 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201202260003.q1Q035OW083472@fire.js.berklix.net> To: Artifex Maximus From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Sat, 25 Feb 2012 07:33:39 +0100." Date: Sun, 26 Feb 2012 01:03:05 +0100 Sender: jhs@berklix.com Cc: freebsd-questions@freebsd.org Subject: Re: clang vs gcc linking problem 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: Sun, 26 Feb 2012 00:03:32 -0000 Artifex Maximus wrote: > Hello! > > Absolutely not a flame war but would like to switch to clang in a > project. Project uses ncurses. gcc works well but the executable fails > when compiled other than -O0. Then I think I should change to clang > which will becomes the default compiler in FreeBSD. With clang at > linking time I got the following error: > > /usr/local/bin/ld: display/libsub_display.a(canvas.o): undefined > reference to symbol 'keypad' > /usr/local/bin/ld: note: 'keypad' is defined in DSO > /usr/local/lib/libtinfow.so.6.0 so try adding it to the linker command > line > /usr/local/lib/libtinfow.so.6.0: could not read symbols: Invalid operation > clang: error: linker command failed with exit code 1 (use -v to see invocation) > *** Error code 1 > > With exactly the same flags gcc links successful. Any idea where is > the problem and what is the solution? > > Thanks, There have been quite a number of discussions on Gcc & Clang of various lists since efforts to transition started, I don't see a specific list here, http://lists.freebsd.org/mailman/listinfo but this may interest http://wiki.freebsd.org/BuildingFreeBSDWithClang Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Reply below not above, cumulative like a play script, & indent with "> ". Format: Plain text. Not HTML, multipart/alternative, base64, quoted-printable. Mail from @yahoo dumped @berklix. http://berklix.org/yahoo/