<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to External Library</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/dddc924b0f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/dddc924b0f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/dddc924b0f/</id><updated>2020-02-27T21:16:28.484000Z</updated><subtitle>Recent posts to External Library</subtitle><entry><title>External Library</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/dddc924b0f/?limit=25#f8d8" rel="alternate"/><published>2020-02-27T21:16:28.484000Z</published><updated>2020-02-27T21:16:28.484000Z</updated><author><name>RajeshGandhi</name><uri>https://forge.codesys.com/u/rajeshgandhi/</uri></author><id>https://forge.codesys.coma86ab99e7315b5088e888b6ab85355b61533791b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Try by placing the .dll file.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>External Library</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/dddc924b0f/?limit=25#136a" rel="alternate"/><published>2020-02-27T21:16:24.417000Z</published><updated>2020-02-27T21:16:24.417000Z</updated><author><name>danilohalla</name><uri>https://forge.codesys.com/u/danilohalla/</uri></author><id>https://forge.codesys.com3c411c7f73fe580fe98ba575894f44654d86869e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Daniel&lt;/p&gt;
&lt;p&gt;Have you managed to make a C external library work in CoDeSys?&lt;/p&gt;
&lt;p&gt;I tried to compile a simple function that does nothing but return a single short. &lt;/p&gt;
&lt;p&gt;I followed the steps in 'C_IN_32Bit_E.pdf' and everything went ok, I copied the .lib and .obj files to the same folder and the project built with no warnings. &lt;/p&gt;
&lt;p&gt;But when I try to test it on a real PLC I get the message during download of the program: &amp;gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
Unresolved External POUs: LIB_FUN1&lt;/p&gt;
&lt;p&gt;The PLC runs on a SH4 processor architecture, I think this could be a reason to the problem as I compiled the code on Visual C++ 2008 EE.&lt;/p&gt;
&lt;p&gt;Here is my file lib_fun.h&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="cm"&gt;/* Enum definitions */&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="cm"&gt;/* The Prototypes */&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
short&lt;span class="w"&gt; &lt;/span&gt;LIB_FUN1&lt;span class="o"&gt;(&lt;/span&gt;void&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="err"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here is my file lib_fun.c&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;\#&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;C:\Libs\Test\lib_fun.h&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="cm"&gt;/* The implemenation templates */&lt;/span&gt;
&lt;span class="nv"&gt;short&lt;/span&gt; &lt;span class="nv"&gt;LIB_FUN1&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
{
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
} 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Thanks for any help,&lt;/p&gt;
&lt;p&gt;Danilo&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>External Library</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/dddc924b0f/?limit=25#9842" rel="alternate"/><published>2020-02-27T21:16:22.978000Z</published><updated>2020-02-27T21:16:22.978000Z</updated><author><name>Daniel Moreira</name><uri>https://forge.codesys.com/u/daniel-moreira/</uri></author><id>https://forge.codesys.com0852ce3a1e2d9888bc941a92c754477b2a27a3a5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have followed  the steps in 'C_IN_32Bit_E.pdf' to make a obj file to link  a lib made in CodeSys. It works very well when the '.c' file doesn´t use a function made in another  '.c' file. &lt;/p&gt;
&lt;p&gt;However when it happens, the lib from codesys needs more than one obj file to link all functions. &lt;/p&gt;
&lt;p&gt;I would like to know if to build a lib in CodeSys with more than one obj file    from visual c is possible. &lt;/p&gt;
&lt;p&gt;If not, has anybory any alternative or clue to make it?&lt;/p&gt;
&lt;p&gt;I´m looking forward to know any clue...&lt;/p&gt;
&lt;p&gt;Thanks a lot,&lt;/p&gt;
&lt;p&gt;Daniel&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>