<?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>How to add Static library in Project</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84535/how-to-add-static-library-in-project</link><description>Hi All, 
 I am beginner in development on Nordic product. 
 I am using sdk v1.5.1 and nrf5340 for development. 
 I want to add open source library libcorrect.a for Forward error correction in my project.But i am not getting how to add libcorrect.a in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Feb 2022 11:44:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84535/how-to-add-static-library-in-project" /><item><title>RE: How to add Static library in Project</title><link>https://devzone.nordicsemi.com/thread/352036?ContentTypeID=1</link><pubDate>Wed, 09 Feb 2022 11:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8718220e-c00a-4478-8233-57a250a7644b</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Well, from the message it is not clear, which tool is emitting the error message. Usually, it should be your linker and from the error message, it looks like, that the library that you are using is build for /from a different tool chain (aka compiler + linker).&lt;/p&gt;
&lt;p&gt;Do get a better overview, you might try to invoke cmake / make from your command line. If you prepend&amp;nbsp;`VERBOSE=1 ` to your make invocation, you will see which tool exactly is complaining and how this tools was invoked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Static library in Project</title><link>https://devzone.nordicsemi.com/thread/352032?ContentTypeID=1</link><pubDate>Wed, 09 Feb 2022 11:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:498026aa-08e6-4290-a575-35ff85f69f51</guid><dc:creator>Bipin_C</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the response.&lt;/p&gt;
&lt;p&gt;i have added following line in cmake file-&lt;/p&gt;
&lt;p&gt;target_link_libraries(app PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../common/lib/libcorrect.a)&lt;/p&gt;
&lt;p&gt;it is giving me following error on compilation&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1644406326963v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;i have only one file(header) associated with library.whose path i have added in in cmake which is in another directory.Do i need to keep .a file and associated header in same directory?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add Static library in Project</title><link>https://devzone.nordicsemi.com/thread/351869?ContentTypeID=1</link><pubDate>Tue, 08 Feb 2022 14:56:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e00de3b4-ac19-45db-8d1d-6583c259657c</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;&lt;a href="https://cmake.org/cmake/help/v3.22/command/target_link_libraries.html?highlight=target_link_libraries"&gt;https://cmake.org/cmake/help/v3.22/command/target_link_libraries.html?highlight=target_link_libraries&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In your case, this would be a &amp;quot;A plain library name&amp;quot;, You probably would also have to add the include path for the headers of that library. To receive good answers to questions, try to give the entire error messages, you received by tools and what tool you received that message from.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>