From owner-freebsd-net@freebsd.org Sun May 8 21:50:39 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10C6DB32BE8 for ; Sun, 8 May 2016 21:50:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D16061093 for ; Sun, 8 May 2016 21:50:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x236.google.com with SMTP id s8so78840454ign.0 for ; Sun, 08 May 2016 14:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=UZwVphRZVn9XyK9lV6EAn+GpawgNhX6tGxfNnH7bCv8=; b=pVYeslsUXHVLRcvFL1j/1TNOfamYkX2vUM+7pohXHQg6mwbf33cJupC7TCeMYaM04Q pYsV9kMCKzWIlp5/xC96CmUdPW9i6zibcZZU6d2lcIcQAMu13cjmpUmRFe6AL7HhuSPI obBz3S9Ic1BUODjMOX+eNw8z/WT7ApOEnYQxfG//pgVwClZxH9yl3mSIZtCpdj/Abu4A yC3UuNkI4Cdr8KBkNOLsmUm3Y1jvPTpE5WkAr2HDMaV/DIaL6YjBvzyZt2vIXBliAXvB 5GlxNj4g2U6lTwEfj5iAOtRWb0VddS+aPCB+nBfo3co6X4sRfU3PgS0FLhXqGP+4CEbv RNTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=UZwVphRZVn9XyK9lV6EAn+GpawgNhX6tGxfNnH7bCv8=; b=GOxlhRugyIfV204Qp+PYXiJ1KDZmd2s0V6CvpWOVTKyq5SDGvFrMYThOdsncsCtRVP +m5NcCQnurWIfiinLmpcGm3UALXHl/3Q4Cs1WlHvCAz1+1TBN0TOe2HqWbaM280RbF4d E7V4EGsvsYeHVblpF9SecllN9xYMS5+zSf9hblt0BQt3cQM0nmZtvdKqbNAnYzCGUcy0 aCaHZ6es4GiCRqYLF0e9Z+1acXLyJsYwiLNYQIzFcyLE7ILJ0GkiAf2Pbn2QzDb5MOby ROLILm14Ssb6CiamN2SFZuYVNwKG88cjctsLCW+G7N8+sADbl2LoDIgVjPo6Oc7i7KPP pgxA== X-Gm-Message-State: AOPr4FU8QF72e/wUpuATOrOwRFk+Eq0uczV6fdEXjWtCvZUzsVd2i0t8Uvit1dl3Cu7FmQR4M2Msx5+3JzAM6w== MIME-Version: 1.0 X-Received: by 10.50.3.73 with SMTP id a9mr7447493iga.22.1462744238290; Sun, 08 May 2016 14:50:38 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Sun, 8 May 2016 14:50:38 -0700 (PDT) In-Reply-To: References: Date: Sun, 8 May 2016 14:50:38 -0700 Message-ID: Subject: Re: [FreeBSD 10-3] undefined reference to getsourcefilter /setsourcefilter From: Adrian Chadd To: Victor Toni Cc: FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2016 21:50:39 -0000 Some extern "C" { } around some includes? :) -a On 8 May 2016 at 14:46, Victor Toni wrote: > Trying to port mcproxy to FreeBSD I encountered a quite strange problem. > Compiling everything works but linking fails with the following error: > > $ c++ -v -Wl,-rpath,/usr/local/lib -pthread -o mcproxy main.o > hamcast_logging.o mc_socket.o addr_storage.o mroute_socket.o if_prop.o > reverse_path_filter.o proxy.o sender.o receiver.o mld_receiver.o > igmp_receiver.o mld_sender.o igmp_sender.o proxy_instance.o routing.o > worker.o timing.o check_if.o check_kernel.o membership_db.o querier.o > timers_values.o interfaces.o def.o simple_mc_proxy_routing.o > simple_routing_data.o scanner.o token.o configuration.o parser.o > interface.o -L/usr/local/lib -L/usr/lib -lpthread > FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 > Target: i386-unknown-freebsd10.3 > Thread model: posix > Selected GCC installation: > "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 > --hash-style=both --enable-new-dtags -m elf_i386_fbsd -o mcproxy > /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib > -L/usr/lib -L/usr/lib -rpath /usr/local/lib main.o hamcast_logging.o > mc_socket.o addr_storage.o mroute_socket.o if_prop.o reverse_path_filter.o > proxy.o sender.o receiver.o mld_receiver.o igmp_receiver.o mld_sender.o > igmp_sender.o proxy_instance.o routing.o worker.o timing.o check_if.o > check_kernel.o membership_db.o querier.o timers_values.o interfaces.o def.o > simple_mc_proxy_routing.o simple_routing_data.o scanner.o token.o > configuration.o parser.o interface.o -lpthread -lc++ -lm -lgcc --as-needed > -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s > --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o > mc_socket.o: In function `mc_socket::set_source_filter(unsigned int, > addr_storage const&, unsigned int, std::__1::list std::__1::allocator > const&) const': > src/utils/mc_socket.cpp:(.text+0x29cc): undefined reference to > `setsourcefilter(int, unsigned int, sockaddr*, unsigned int, unsigned int, > unsigned int, sockaddr_storage*)' > mc_socket.o: In function `mc_socket::get_source_filter(unsigned int, > addr_storage const&, unsigned int&, std::__1::list std::__1::allocator >&) const': > src/utils/mc_socket.cpp:(.text+0x2c29): undefined reference to > `getsourcefilter(int, unsigned int, sockaddr*, unsigned int, unsigned int*, > unsigned int*, sockaddr_storage*)' > src/utils/mc_socket.cpp:(.text+0x2cae): undefined reference to > `getsourcefilter(int, unsigned int, sockaddr*, unsigned int, unsigned int*, > unsigned int*, sockaddr_storage*)' > c++: error: linker command failed with exit code 1 (use -v to see > invocation) > > The methods should be found: > > $ readelf -s /usr/lib/libc.a | grep etsourcefilter > 10: 00000600 392 FUNC GLOBAL DEFAULT 1 getsourcefilter > 12: 00000290 305 FUNC GLOBAL DEFAULT 1 setsourcefilter > > > What am I missing? > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"