From owner-freebsd-questions@FreeBSD.ORG Sat Feb 25 07:00:52 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 51595106566C for ; Sat, 25 Feb 2012 07:00:52 +0000 (UTC) (envelope-from artifexor@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 187788FC13 for ; Sat, 25 Feb 2012 07:00:51 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so4783825obc.13 for ; Fri, 24 Feb 2012 23:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of artifexor@gmail.com designates 10.60.21.38 as permitted sender) client-ip=10.60.21.38; Authentication-Results: mr.google.com; spf=pass (google.com: domain of artifexor@gmail.com designates 10.60.21.38 as permitted sender) smtp.mail=artifexor@gmail.com; dkim=pass header.i=artifexor@gmail.com Received: from mr.google.com ([10.60.21.38]) by 10.60.21.38 with SMTP id s6mr2253711oee.50.1330153251687 (num_hops = 1); Fri, 24 Feb 2012 23:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=38wjWZijGB4/BCMEkrIiUGKsYoT75Kq3Ab7HF2RfWtg=; b=G0txczzg2duWxB424pptbgy4ms/DdewacVV1bCwURYkEamHEpm6omwUpPidnbiBHvQ ElcAfpuglKB9QCYttykdOIeXmTUBw+K0V5FaimPkuwbJJAguadyygpfp39C66RrJawql cv9354NTofc9hlqEhPI+i340CMq9rNvZ9ULpk= MIME-Version: 1.0 Received: by 10.60.21.38 with SMTP id s6mr1942386oee.50.1330151619189; Fri, 24 Feb 2012 22:33:39 -0800 (PST) Received: by 10.60.15.161 with HTTP; Fri, 24 Feb 2012 22:33:39 -0800 (PST) Date: Sat, 25 Feb 2012 07:33:39 +0100 Message-ID: From: Artifex Maximus To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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: Sat, 25 Feb 2012 07:00:52 -0000 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, a