From owner-freebsd-net@freebsd.org Tue May 17 06:37:35 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 6D407B3E081 for ; Tue, 17 May 2016 06:37:35 +0000 (UTC) (envelope-from victor.toni@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 EE40A1DDE for ; Tue, 17 May 2016 06:37:34 +0000 (UTC) (envelope-from victor.toni@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id a17so12650998wme.0 for ; Mon, 16 May 2016 23:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6RT6tyi0cAQ3SRcMoP9N3Bo9egWjl6+sgnV+ivw+OvU=; b=Lw3agMfUfi9tE3wQsupPh/6F0mYtb5fir3wIl1Z7F2kFSea03ZQsB/LYmnWkXnhW5v boFqpKwu02sL7YdUmfo4bE6NBgUWih9L4bhI3nCpq+4sklPnzkNvebeyqMGnEOf4MI8q CLbZbsCtUlxMUiP1hSK2P6MthLW+4fJJMaJMp8X0PKbRgXXRZltOo45cS3mdGBeqXbn4 LdMVjnKaGnZFjEsamPp0Y2FaoZ54e/f0Gq2aOwsCugV24uZDz8jrWpVKCRYzfPZZk4m9 dXvc+xKe7DbqJ9/lgqCp1DCxKUPMgoTxEsxl+icvU2L/L8Rjfp2PBYmul+rr6S7tfGpX ZzTg== 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:from:date :message-id:subject:to:cc; bh=6RT6tyi0cAQ3SRcMoP9N3Bo9egWjl6+sgnV+ivw+OvU=; b=eebdB1wkwabn1TQqCoy3oEqzE6DOO84/edHEvdYYXv4WBD8vPuDbLiUyFkdhW82wfW W8A8QpCPiV+poN8xKM40k1PIztM3YyEUR8lJiIerzIcNhGS8gajd/FQrnkIFyAPADxli sqru0b39WCRXMKYEEBn3v76mVKNXeG0JPjY3gUN0p7tT0ius0GeJf8i8nRSX32LjRkNi uQ8qlBep2p2U+L/eBgBOwo/jJ2mN417JdHk7Y4J6VnR8Kbdo0vFUefNewlKIw10tLI43 HOpQ+HN8bNJWYVHiZ9Bq6gAqiNsx7LXIA1czQf3mVybSvtwxrJb0G1cRQuaSB+2Gz685 iTzg== X-Gm-Message-State: AOPr4FVj0IZKOIdhRStFgxcNDdzUhJUS6RJj7PB/blnaQVk4mIvTNZO7+qCk6MetV5vY7erEdHn9CzVCq1a6Hw== X-Received: by 10.28.222.8 with SMTP id v8mr21240530wmg.83.1463467053359; Mon, 16 May 2016 23:37:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.23.199 with HTTP; Mon, 16 May 2016 23:37:03 -0700 (PDT) In-Reply-To: References: From: Victor Toni Date: Tue, 17 May 2016 08:37:03 +0200 Message-ID: Subject: Re: [FreeBSD 10-3] undefined reference to getsourcefilter /setsourcefilter To: Adrian Chadd Cc: FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 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: Tue, 17 May 2016 06:37:35 -0000 Thank you.for the hint. Exactly what I needed to get it working and polish my rusty C skills up. 2016-05-08 23:50 GMT+02:00 Adrian Chadd : > 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" >