<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Visual C++ configuration for external library compilation</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/7c4d1468b0/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/7c4d1468b0/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/7c4d1468b0/</id><updated>2020-02-27T20:30:50.028000Z</updated><subtitle>Recent posts to Visual C++ configuration for external library compilation</subtitle><entry><title>Visual C++ configuration for external library compilation</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/7c4d1468b0/?limit=25#8509" rel="alternate"/><published>2020-02-27T20:30:50.028000Z</published><updated>2020-02-27T20:30:50.028000Z</updated><author><name>Daniel Moreira</name><uri>https://forge.codesys.com/u/daniel-moreira/</uri></author><id>https://forge.codesys.com75a44b9cf7711381103e8ffbebcc5653aab67f5a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe you have solved this problem, but may I help you...&lt;/p&gt;
&lt;p&gt;Well, I´ve been trying do the same thing. &lt;/p&gt;
&lt;p&gt;Your code in .c has a problem. The return type function was declared as 'int'. This type has 32 bits in the visual c++ and this type in CodeSys may have less bits than 32.&lt;/p&gt;
&lt;p&gt;I guess you need to make one specific '#define' to solve it.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;#define INT short &lt;/p&gt;
&lt;p&gt;So, you can use 'INT' and not 'int' to build your obj file...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Visual C++ configuration for external library compilation</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/7c4d1468b0/?limit=25#0988" rel="alternate"/><published>2020-02-27T20:30:48.658000Z</published><updated>2020-02-27T20:30:48.658000Z</updated><author><name>MOUNIER Laurent</name><uri>https://forge.codesys.com/u/mounier-laurent/</uri></author><id>https://forge.codesys.comc4818d563b4fbab3b073497d09466faad4778b4c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to create an external C library with Visual C++ 2005 Express. To test the process I am using the following code:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: blue;"&gt;/&lt;em&gt; Enum definitions &lt;/em&gt;/&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/&lt;em&gt; The Prototypes &lt;/em&gt;/&lt;br/&gt;
int LIB_FUN1(void);&lt;/p&gt;
&lt;p&gt;&lt;span style="color: blue;"&gt;#include "D:\temp\codesys\TEST_LIB2.h"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/&lt;em&gt; The implemenation templates &lt;/em&gt;/&lt;br/&gt;
int LIB_FUN1(void)&lt;br/&gt;
{&lt;br/&gt;
    return 2;&lt;br/&gt;
}&lt;/p&gt;
&lt;p&gt;I have done configuration of Visual C++ as explained in the document "C_IN_32Bit_E.doc". I had no error during compilation.&lt;/p&gt;
&lt;p&gt;I have copied the file TEST_LIB2.obj in the directory of TEST_LIB2.lib, and  I have added the library to my Codesys project.&lt;/p&gt;
&lt;p&gt;The target of my project is "3S CoDeSys SP PLCWinNT V2.4".&lt;/p&gt;
&lt;p&gt;When I tried to compile in Codesys, I had the warning 1902 and was unable to upload my project in PLCWinNT.&lt;/p&gt;
&lt;p&gt;I think the problem is in configuration of Visual C++ project because the function LIB_FUN1 is very simple. &lt;/p&gt;
&lt;p&gt;Does somebody have any information about such a warning? Is there a more precise explanation about configuration of visual C++ options?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Laurent&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>