<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Compile part of application as static library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80417/compile-part-of-application-as-static-library</link><description>I am trying to separate part of my application into static library and link it to the app. I have read https://docs.zephyrproject.org/latest/application/index.html and cmake documentation. 
 In my app folder I have CMakeLists.txt 
 
 in src/mylib I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Aug 2023 23:43:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80417/compile-part-of-application-as-static-library" /><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/441023?ContentTypeID=1</link><pubDate>Fri, 11 Aug 2023 23:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbbcf418-e97e-4658-8d74-e68f79f9a2a7</guid><dc:creator>pauleffect</dc:creator><description>&lt;p&gt;saved my butt, buddy. thanks a million.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333282?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:782f8db8-ef61-4d5d-8789-588c4068afd9</guid><dc:creator>wodz</dc:creator><description>&lt;p&gt;Thanks, that did the trick. Would be nice to have it documented somewhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333280?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8d4f5c0-4d44-4ab4-81a4-e926a13dc74e</guid><dc:creator>Torsten Rasmussen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;To inherit the compile flags used by the Zephyr project you should link your library to the zephyr_interface interface lib, like this:&lt;br /&gt;```&lt;/p&gt;
&lt;p&gt;target_link_libraries(mylib PUBLIC zephyr_interface)&lt;br /&gt;```&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333182?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 07:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:523ccfdf-ccab-44d2-90ea-63b28a21f129</guid><dc:creator>wodz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/static_5F00_lib.zip"&gt;devzone.nordicsemi.com/.../static_5F00_lib.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the simplest app I could come with. See README.txt for compile error and output from readelf which illustrate the error origin. Object files are included as well so you can study it yourself. I tried both with command line and vscode nrf extension both giving the same error (no surprise here).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333164?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 06:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1680ea82-0be8-441c-aeed-9c86ad04d5bf</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Ok, I tried reproducing this, and I only got an error in SES.&lt;/p&gt;
&lt;p&gt;Could you reproduce this in as simple an application as possible, zip it and attach it here?&lt;br /&gt;You can attach files inline with text using Insert-&amp;gt;Image/video/file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333110?ContentTypeID=1</link><pubDate>Thu, 07 Oct 2021 15:53:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e91d2ba-3f01-47f7-9c4e-c70651d1625e</guid><dc:creator>wodz</dc:creator><description>&lt;p&gt;No, I am using west from comandline&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile part of application as static library</title><link>https://devzone.nordicsemi.com/thread/333083?ContentTypeID=1</link><pubDate>Thu, 07 Oct 2021 13:40:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff5bb20-6e8b-4c88-8d3a-275e46014947</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you building this in SEGGER Embedded Studio? &lt;br /&gt;If so, could you try building it on the command line instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>