From owner-freebsd-questions@freebsd.org Fri Dec 7 18:43:47 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E98A13166DA for ; Fri, 7 Dec 2018 18:43:47 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61203724A4 for ; Fri, 7 Dec 2018 18:43:46 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id wB7IhiUR081283 for ; Fri, 7 Dec 2018 11:43:44 -0700 (MST) (envelope-from freebsd@dreamchaser.org) To: FreeBSD Mailing List Reply-To: freebsd@dreamchaser.org From: Gary Aitken Subject: -lfoo vs /usr/local/lib/libfoo.so Message-ID: <4e4f02e8-18b5-4e3e-2887-922946498bf1@dreamchaser.org> Date: Fri, 7 Dec 2018 11:43:29 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Fri, 07 Dec 2018 11:43:44 -0700 (MST) X-Rspamd-Queue-Id: 61203724A4 X-Spamd-Result: default: False [-1.26 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd@dreamchaser.org]; NEURAL_HAM_MEDIUM(-0.45)[-0.450,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[dreamchaser.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.93)[-0.927,0]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: nightmare.dreamchaser.org]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; IP_SCORE(-0.02)[country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:21947, ipnet:66.109.128.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2018 18:43:47 -0000 In trying to build a dev version of a port, the cmake script includes many libraries explicitly, and one (-lhdf5-18) using -l: /usr/bin/c++ -fPIC -Wall -Wextra -Wno-write-strings -O2 -pipe -I/usr/local/include/hdf5-18 -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -std=c++11 -Wno-undefined-var-template -D_OCC64 -O2 -pipe -I/usr/local/include/hdf5-18 -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -Wl,--no-undefined -shared -Wl,-soname,libFreeCADBase.so -o ../../lib/libFreeCADBase.so ... a bunch of .o files ... -Wl,-rpath,/usr/local/lib:/usr/local/lib/qt4: -lhdf5-18 /usr/local/lib/libpython2.7.so ... ... -lpthread -lz /usr/local/lib/qt4/libQtCore.so The above command fails with "/usr/bin/ld: cannot find -lhdf5-18" although /usr/local/lib/libhdf5-18.so exists and the rpath flag indicates /usr/local/lib If I replace -lhdf5-18 with /usr/local/lib/libhdf5-18.so it works. Curiously (to me) -lpthread and -lz are apparently working correctly, or at least aren't being mis-interpreted. I've tried tweaking the command to use -Wl,-lhdf5-18 but that fails also. Can anyone explain to me what's going on? Gary