[Nfd-dev] Error building on macOS 10.11

Thompson, Jeff jefft0 at remap.ucla.edu
Sat Sep 8 10:40:17 PDT 2018


Thanks. It kind of hurts my brain that the variable is defined in the cpp
file without a value, and the value is supplied in the header file. Seems
backwards, and hard to imagine how/when the variable gets filled.

On 2018/9/8, 10:28:06, "Davide Pesavento" <davidepesa at gmail.com> wrote:

>If the symbol is ODR-used, there must be a definition somewhere at
>namespace scope. Your fix is correct. This is a quirk of C++11/14 with
>constexpr static data members that was fixed in C++17 with inline
>variables.
>
>What I don't understand is why neither our Jenkins CI nor Travis
>aren't catching this error...
>
>(and yes, that "Checking C++ compiler version: 8.0.0" is expected,
>clang in Xcode 8.2.x still identifies itself as 8.0.0)
>
>On Sat, Sep 8, 2018 at 10:17 AM Thompson, Jeff <jefft0 at remap.ucla.edu>
>wrote:
>>
>> … NFD builds if I put the following in transport.cpp:
>>
>>     constexpr ssize_t Transport::MIN_MTU;
>>
>> - Jeff T
>>
>> From: Jeff Thompson <jefft0 at remap.ucla.edu>
>> Date: Saturday, September 8, 2018 at 6:31:00
>> To: Davide Pesavento <davidepesa at gmail.com>
>> Cc: nfd-dev <nfd-dev at lists.cs.ucla.edu>
>> Subject: Re: [Nfd-dev] Error building on macOS 10.11
>>
>> Hi Davide,
>>
>> I installed Xcode 8.2.1. (Now, waf configure says “Checking C++
>>compiler version: 8.0.0”.)  I get the following error building NFD. It’s
>>confusing to me that the linker can’t find MIN_MTU because it is defined
>>as “static constexpr”. It should be compiled in, right? Why does the
>>linker need to find it?
>>
>> 160/160] Linking build/bin/nfd
>>
>> Undefined symbols for architecture x86_64:
>>
>>   "nfd::face::Transport::MIN_MTU", referenced from:
>>
>>       
>>nfd::face::UdpFactory::createFace(nfd::face::ProtocolFactory::CreateFaceR
>>equest const&, std::__1::function<void
>>(std::__1::shared_ptr<nfd::face::Face> const&)> const&,
>>std::__1::function<void (unsigned int, std::__1::basic_string<char,
>>std::__1::char_traits<char>, std::__1::allocator<char> > const&)>
>>const&) in udp-factory.cpp.3.o
>>
>>       
>>nfd::face::EthernetFactory::createFace(nfd::face::ProtocolFactory::Create
>>FaceRequest const&, std::__1::function<void
>>(std::__1::shared_ptr<nfd::face::Face> const&)> const&,
>>std::__1::function<void (unsigned int, std::__1::basic_string<char,
>>std::__1::char_traits<char>, std::__1::allocator<char> > const&)>
>>const&) in ethernet-factory.cpp.3.o
>>
>> ld: symbol(s) not found for architecture x86_64
>>
>> clang: error: linker command failed with exit code 1 (use -v to see
>>invocation)
>>
>>
>>
>> From: Davide Pesavento <davidepesa at gmail.com>
>> Date: Friday, September 7, 2018 at 8:37:00
>> To: Jeff Thompson <jefft0 at remap.ucla.edu>
>> Cc: nfd-dev <nfd-dev at lists.cs.ucla.edu>
>> Subject: Re: [Nfd-dev] Error building on macOS 10.11
>>
>> Yes, macOS 10.11.5 can run Xcode up to version 8.2.1
>>
>> Davide
>>
>> On Fri, Sep 7, 2018, 11:05 AM Thompson, Jeff <jefft0 at remap.ucla.edu>
>>wrote:
>>>
>>> Hi Davide,
>>>
>>> Version 7.2. Should version 7.3 be available for macOS 10.11?
>>>
>>> - Jeff T
>>>
>>> On 2018/9/7, 7:15:47, "Davide Pesavento" <davidepesa at gmail.com> wrote:
>>>
>>> >Hi Jeff,
>>> >
>>> >What version of Xcode are you using? 7.3 and 8 both work fine for me
>>> >on macOS 10.11. I don't think we support anything below 7.3, and we
>>> >will probably be raising the minimum to 8 once Xcode 10 is released.
>>> >
>>> >Davide
>>> >
>>> >On Fri, Sep 7, 2018 at 9:07 AM Thompson, Jeff <jefft0 at remap.ucla.edu>
>>> >wrote:
>>> >>
>>> >> Š and if I check out ndn-cxx-0.6.2 and NFD-0.6.2, those build OK.
>>> >>
>>> >> From: Jeff Thompson <jefft0 at remap.ucla.edu>
>>> >> Date: Friday, September 7, 2018 at 6:05:00
>>> >> To: nfd-dev <nfd-dev at lists.cs.ucla.edu>
>>> >> Subject: Error building on macOS 10.11
>>> >>
>>> >> Hi NFD devs,
>>> >>
>>> >> I can build the latest ndn-cxx and NFD on macOS 10.12 and 10.13. But
>>> >>when I build on macOS 10.11 I get the following linker error when
>>> >>building NFD. Any ideas? (In all cases, I¹m using the latest homebrew
>>> >>Boost 1.67.)
>>> >>
>>> >> Thanks,
>>> >> - Jeff T
>>> >>
>>> >> [156/159] Linking build/bin/nfd
>>> >> Undefined symbols for architecture x86_64:
>>> >>   
>>>"ndn::util::scheduler::EventId::EventId(ndn::util::scheduler::EventId
>>> >>const&)", referenced from:
>>> >>
>>> 
>>>>>nfd::face::TcpChannel::connect(boost::asio::ip::basic_endpoint<boost::
>>>>>asi
>>> >>o::ip::tcp> const&, nfd::face::FaceParams const&,
>>> >>std::__1::function<void (std::__1::shared_ptr<nfd::face::Face>
>>>const&)>
>>> >>const&, std::__1::function<void (unsigned int,
>>> >>std::__1::basic_string<char, std::__1::char_traits<char>,
>>> >>std::__1::allocator<char> > const&)> const&,
>>> >>boost::chrono::duration<long long, boost::ratio<1l, 1000000000l> >)
>>>in
>>> >>tcp-channel.cpp.3.o
>>> >>   "nfd::face::FaceParams::FaceParams(nfd::face::FaceParams const&)",
>>> >>referenced from:
>>> >>
>>> 
>>>>>nfd::face::TcpChannel::connect(boost::asio::ip::basic_endpoint<boost::
>>>>>asi
>>> >>o::ip::tcp> const&, nfd::face::FaceParams const&,
>>> >>std::__1::function<void (std::__1::shared_ptr<nfd::face::Face>
>>>const&)>
>>> >>const&, std::__1::function<void (unsigned int,
>>> >>std::__1::basic_string<char, std::__1::char_traits<char>,
>>> >>std::__1::allocator<char> > const&)> const&,
>>> >>boost::chrono::duration<long long, boost::ratio<1l, 1000000000l> >)
>>>in
>>> >>tcp-channel.cpp.3.o
>>> >>
>>> 
>>>>>boost::asio::detail::binder1<nfd::face::TcpChannel::connect(boost::asi
>>>>>o::
>>> >>ip::basic_endpoint<boost::asio::ip::tcp> const&,
>>>nfd::face::FaceParams
>>> >>const&, std::__1::function<void
>>>(std::__1::shared_ptr<nfd::face::Face>
>>> >>const&)> const&, std::__1::function<void (unsigned int,
>>> >>std::__1::basic_string<char, std::__1::char_traits<char>,
>>> >>std::__1::allocator<char> > const&)> const&,
>>> >>boost::chrono::duration<long long, boost::ratio<1l, 1000000000l>
>>> >>>)::$_3,
>>> 
>>>>>>boost::system::error_code>::binder1(boost::asio::detail::binder1<nfd:
>>>>>>:fa
>>> 
>>>>>>ce::TcpChannel::connect(boost::asio::ip::basic_endpoint<boost::asio::
>>>>>>ip:
>>> >>>:tcp> const&, nfd::face::FaceParams const&, std::__1::function<void
>>> >>>(std::__1::shared_ptr<nfd::face::Face> const&)> const&,
>>> >>>std::__1::function<void (unsigned int, std::__1::basic_string<char,
>>> >>>std::__1::char_traits<char>, std::__1::allocator<char> > const&)>
>>> >>>const&, boost::chrono::duration<long long, boost::ratio<1l,
>>> >>>1000000000l> >)::$_3, boost::system::error_code>&&) in
>>> >>>tcp-channel.cpp.3.o
>>> >>
>>> 
>>>>>boost::asio::detail::reactive_socket_connect_op<nfd::face::TcpChannel:
>>>>>:co
>>> >>nnect(boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> const&,
>>> >>nfd::face::FaceParams const&, std::__1::function<void
>>> >>(std::__1::shared_ptr<nfd::face::Face> const&)> const&,
>>> >>std::__1::function<void (unsigned int, std::__1::basic_string<char,
>>> >>std::__1::char_traits<char>, std::__1::allocator<char> > const&)>
>>> >>const&, boost::chrono::duration<long long, boost::ratio<1l,
>>>1000000000l>
>>> >>>)::$_3>::do_complete(void*,
>>>boost::asio::detail::scheduler_operation*,
>>> >>>boost::system::error_code const&, unsigned long) in
>>>tcp-channel.cpp.3.o
>>> >> ld: symbol(s) not found for architecture x86_64
>>> >> clang: error: linker command failed with exit code 1 (use -v to see
>>> >>invocation)
>>> >>
>>> >> _______________________________________________
>>> >> Nfd-dev mailing list
>>> >> Nfd-dev at lists.cs.ucla.edu
>>> >> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
>>>



More information about the Nfd-dev mailing list