<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Linking failure for tiny code using YDK-CPP in Tools</title>
    <link>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3922072#M2146</link>
    <description>&lt;P&gt;That helped, Thanks !&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 20:28:10 GMT</pubDate>
    <dc:creator>Alexandr_Limonov</dc:creator>
    <dc:date>2019-09-10T20:28:10Z</dc:date>
    <item>
      <title>Linking failure for tiny code using YDK-CPP</title>
      <link>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3921924#M2144</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;Could you plz help me and point what am doing wrong ?&lt;BR /&gt;&lt;BR /&gt;I compiled core ydk-cpp core , ydk-ietf and, ios-xr from source.&lt;BR /&gt;However during attempt of building of my tiny code I have huge amount of linker failures :&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;EM&gt;/usr/bin/x86_64-linux-gnu-g++-5 -g3 -std=c++11 -pthread \&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; -L/usr/local/lib main.cpp output.o \&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; -lydk -lydk_cisco_ios_xr -lydk_ietf -lpcre -ldl&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;(build log in attachement)&lt;BR /&gt;&lt;BR /&gt;Tiny code is:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include &amp;lt;iostream&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include &amp;lt;memory&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include "ydk/types.hpp"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include "ydk/netconf_provider.hpp"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include "ydk/crud_service.hpp"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include &amp;lt;spdlog/spdlog.h&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include "ydk_cisco_ios_xr/Cisco_IOS_XR_ipv4_bgp_cfg.hpp"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;#include "ydk_cisco_ios_xr/Cisco_IOS_XR_ipv4_bgp_datatypes.hpp"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;// #include "args_parser.h"&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;using namespace ydk;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;using namespace cisco_ios_xr::Cisco_IOS_XR_ipv4_bgp_cfg;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;using namespace cisco_ios_xr::Cisco_IOS_XR_ipv4_bgp_datatypes;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;using namespace std;&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;int main(){&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;auto bgp = make_unique&amp;lt;Bgp&amp;gt;();&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;auto instance = make_unique&amp;lt;Bgp::Instance&amp;gt;();&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;auto instance_as = make_unique&amp;lt;Bgp::Instance::InstanceAs&amp;gt;();&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;instance_as-&amp;gt;as = 65001;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;instance-&amp;gt;instance_as.append(move(instance_as));&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;bgp-&amp;gt;instance.append(move(instance));&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;return 0;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;What do I miss here ?&lt;BR /&gt;&lt;BR /&gt;Thanks !&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 16:34:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3921924#M2144</guid>
      <dc:creator>Alexandr_Limonov</dc:creator>
      <dc:date>2019-09-10T16:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Linking failure for tiny code using YDK-CPP</title>
      <link>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3921934#M2145</link>
      <description>&lt;P&gt;Hi Alezandr&lt;/P&gt;
&lt;P&gt;I suggest you to look at &lt;A href="https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/cpp/samples/CMakeLists.txt" target="_self"&gt;CMakeLists.txt&lt;/A&gt; in C++ samples. Here what we have for the linker:&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt; target_link_libraries(${sample}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ydk_location} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ydk_openconfig_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ydk_cisco_ios_xr_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ydk_cisco_ios_xe_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${xml2_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${curl_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ssh_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${ssh_threads_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${pcre_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${xslt_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${pthread_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;${dl_location}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;-rdynamic&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;First, add all the missing libraries and parameters.&lt;/P&gt;
&lt;P&gt;Second, try to move the bundle library to the front; sometimes that helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Yan&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:02:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3921934#M2145</guid>
      <dc:creator>ygorelik</dc:creator>
      <dc:date>2019-09-10T17:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Linking failure for tiny code using YDK-CPP</title>
      <link>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3922072#M2146</link>
      <description>&lt;P&gt;That helped, Thanks !&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 20:28:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/linking-failure-for-tiny-code-using-ydk-cpp/m-p/3922072#M2146</guid>
      <dc:creator>Alexandr_Limonov</dc:creator>
      <dc:date>2019-09-10T20:28:10Z</dc:date>
    </item>
  </channel>
</rss>

