<?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 How to prevent ICC from mangling function names in C code that uses IPP? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-prevent-ICC-from-mangling-function-names-in-C-code-that/m-p/990367#M22221</link>
    <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;When I compile the following source code, it appears that Intel C++ Compiler is mangling "ippsDESBufferSize" regardless of the "/TC" option. __cplusplus is also not defined.&lt;BR /&gt;&lt;BR /&gt;#include "stdio.h"&lt;BR /&gt;#include "ippCP.h"&lt;BR /&gt;&lt;BR /&gt;int WinMainCRTStartup() {&lt;BR /&gt;int result, size;&lt;BR /&gt;&lt;BR /&gt;result = (int) ippsDESBufferSize(&amp;amp;size);&lt;BR /&gt;printf("Result: %d, size: %d
", result, size);&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;printf("def __cplusplus
");&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;When I try to link the object (compiled with ICC) of this source file with ippCP_XSC41PPC_r.lib in order to generate the executable, I receive this error from the linker:&lt;BR /&gt;&lt;BR /&gt;Compiling...&lt;BR /&gt;main.c&lt;BR /&gt;Linking...&lt;BR /&gt;main.obj : error LNK2001: unresolved external symbol _ippsDESBufferSize@4&lt;BR /&gt;ARMV4Rel/tstajd.exe : fatal error LNK1120: 1 unresolved externals&lt;BR /&gt;&lt;BR /&gt;If I use Microsoft eMbedded Visual C++ to compile the source file, the executable is generated without any errors. The same applies to gcc in Linux.&lt;BR /&gt;&lt;BR /&gt;Any ideas of how I can solve this problem?&lt;BR /&gt;&lt;BR /&gt;Environment:&lt;BR /&gt;* Microsoft Windows 2000 Professional&lt;BR /&gt;* Microsoft eMbedded Visual C++ 4&lt;BR /&gt;* PocketPC 2003&lt;BR /&gt;* Intel XScale C++ Compiler 1.1&lt;BR /&gt;&lt;BR /&gt;--------------------------------&lt;BR /&gt;&lt;BR /&gt;Follow up (May 26th):&lt;BR /&gt;&lt;BR /&gt; From ippdefs.h:&lt;BR /&gt;&lt;BR /&gt;#if defined( _WIN32 ) || defined ( _WIN64 )&lt;BR /&gt;#define __STDCALL __stdcall&lt;BR /&gt;#define __CDECL __cdecl&lt;BR /&gt;#define __INT64 __int64&lt;BR /&gt;#define __UINT64 unsigned __int64&lt;BR /&gt;#else&lt;BR /&gt;#define __STDCALL&lt;BR /&gt;#define __CDECL&lt;BR /&gt;#define __INT64 long long&lt;BR /&gt;#define __UINT64 unsigned long long&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#if !defined( IPPAPI )&lt;BR /&gt;&lt;BR /&gt;#if defined( IPP_W32DLL ) &amp;amp;&amp;amp; (defined( _WIN32 ) || defined( _WIN64 ))&lt;BR /&gt;#if defined( _MSC_VER ) || defined( __ICL )&lt;BR /&gt;#define IPPAPI( type,name,arg ) 
&lt;BR /&gt;extern __declspec(dllimport) type __STDCALL name arg;&lt;BR /&gt;#else&lt;BR /&gt;#define IPPAPI( type,name,arg ) extern type __STDCALL name arg;&lt;BR /&gt;#endif&lt;BR /&gt;#else&lt;BR /&gt;#define IPPAPI( type,name,arg ) extern type __STDCALL name arg;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Intel C++ Compiler seems to define _WIN32 when compiling code for WinCE on ARM/XScale and therefore all functions are declared as __stdcall. From &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_adjusting_naming_conventions.asp" target="_blank"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_adjusting_naming_conventions.asp&lt;/A&gt; ,&lt;BR /&gt;&lt;BR /&gt;__cdecl _name Mixed case preserved&lt;BR /&gt;__stdcall _name@nn Mixed case preserved&lt;BR /&gt;&lt;BR /&gt;I've dumped the symbols in Intel IPP ippCP_XSC41PPC_r.lib for ARM/XScale and none of them have the __stdcall naming convention, so I suppose they were compiled with __cdecl. Would this be a issue in ippdefs.h (__cdecl should be default for WinCE) or in Intel C++ Compiler (_WIN32 shouldn't be defined for WinCE -- only _W32_WCE should be defined)?&lt;P&gt;Message Edited by augustojd on &lt;SPAN class="date_text"&gt;05-26-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:32 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2005 01:42:10 GMT</pubDate>
    <dc:creator>augustojd</dc:creator>
    <dc:date>2005-05-26T01:42:10Z</dc:date>
    <item>
      <title>How to prevent ICC from mangling function names in C code that uses IPP?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-prevent-ICC-from-mangling-function-names-in-C-code-that/m-p/990367#M22221</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;When I compile the following source code, it appears that Intel C++ Compiler is mangling "ippsDESBufferSize" regardless of the "/TC" option. __cplusplus is also not defined.&lt;BR /&gt;&lt;BR /&gt;#include "stdio.h"&lt;BR /&gt;#include "ippCP.h"&lt;BR /&gt;&lt;BR /&gt;int WinMainCRTStartup() {&lt;BR /&gt;int result, size;&lt;BR /&gt;&lt;BR /&gt;result = (int) ippsDESBufferSize(&amp;amp;size);&lt;BR /&gt;printf("Result: %d, size: %d
", result, size);&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;printf("def __cplusplus
");&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;When I try to link the object (compiled with ICC) of this source file with ippCP_XSC41PPC_r.lib in order to generate the executable, I receive this error from the linker:&lt;BR /&gt;&lt;BR /&gt;Compiling...&lt;BR /&gt;main.c&lt;BR /&gt;Linking...&lt;BR /&gt;main.obj : error LNK2001: unresolved external symbol _ippsDESBufferSize@4&lt;BR /&gt;ARMV4Rel/tstajd.exe : fatal error LNK1120: 1 unresolved externals&lt;BR /&gt;&lt;BR /&gt;If I use Microsoft eMbedded Visual C++ to compile the source file, the executable is generated without any errors. The same applies to gcc in Linux.&lt;BR /&gt;&lt;BR /&gt;Any ideas of how I can solve this problem?&lt;BR /&gt;&lt;BR /&gt;Environment:&lt;BR /&gt;* Microsoft Windows 2000 Professional&lt;BR /&gt;* Microsoft eMbedded Visual C++ 4&lt;BR /&gt;* PocketPC 2003&lt;BR /&gt;* Intel XScale C++ Compiler 1.1&lt;BR /&gt;&lt;BR /&gt;--------------------------------&lt;BR /&gt;&lt;BR /&gt;Follow up (May 26th):&lt;BR /&gt;&lt;BR /&gt; From ippdefs.h:&lt;BR /&gt;&lt;BR /&gt;#if defined( _WIN32 ) || defined ( _WIN64 )&lt;BR /&gt;#define __STDCALL __stdcall&lt;BR /&gt;#define __CDECL __cdecl&lt;BR /&gt;#define __INT64 __int64&lt;BR /&gt;#define __UINT64 unsigned __int64&lt;BR /&gt;#else&lt;BR /&gt;#define __STDCALL&lt;BR /&gt;#define __CDECL&lt;BR /&gt;#define __INT64 long long&lt;BR /&gt;#define __UINT64 unsigned long long&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#if !defined( IPPAPI )&lt;BR /&gt;&lt;BR /&gt;#if defined( IPP_W32DLL ) &amp;amp;&amp;amp; (defined( _WIN32 ) || defined( _WIN64 ))&lt;BR /&gt;#if defined( _MSC_VER ) || defined( __ICL )&lt;BR /&gt;#define IPPAPI( type,name,arg ) 
&lt;BR /&gt;extern __declspec(dllimport) type __STDCALL name arg;&lt;BR /&gt;#else&lt;BR /&gt;#define IPPAPI( type,name,arg ) extern type __STDCALL name arg;&lt;BR /&gt;#endif&lt;BR /&gt;#else&lt;BR /&gt;#define IPPAPI( type,name,arg ) extern type __STDCALL name arg;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Intel C++ Compiler seems to define _WIN32 when compiling code for WinCE on ARM/XScale and therefore all functions are declared as __stdcall. From &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_adjusting_naming_conventions.asp" target="_blank"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_adjusting_naming_conventions.asp&lt;/A&gt; ,&lt;BR /&gt;&lt;BR /&gt;__cdecl _name Mixed case preserved&lt;BR /&gt;__stdcall _name@nn Mixed case preserved&lt;BR /&gt;&lt;BR /&gt;I've dumped the symbols in Intel IPP ippCP_XSC41PPC_r.lib for ARM/XScale and none of them have the __stdcall naming convention, so I suppose they were compiled with __cdecl. Would this be a issue in ippdefs.h (__cdecl should be default for WinCE) or in Intel C++ Compiler (_WIN32 shouldn't be defined for WinCE -- only _W32_WCE should be defined)?&lt;P&gt;Message Edited by augustojd on &lt;SPAN class="date_text"&gt;05-26-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:32 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2005 01:42:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-prevent-ICC-from-mangling-function-names-in-C-code-that/m-p/990367#M22221</guid>
      <dc:creator>augustojd</dc:creator>
      <dc:date>2005-05-26T01:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent ICC from mangling function names in C code t</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-prevent-ICC-from-mangling-function-names-in-C-code-that/m-p/990368#M22222</link>
      <description>&lt;DIV&gt;Hi,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;IPP functions should be declared as STDCALL. If it is not so please submit yuor issue report to IPP Technical Support (premier.intel.com)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt; Vladimir&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 May 2005 21:41:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-prevent-ICC-from-mangling-function-names-in-C-code-that/m-p/990368#M22222</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2005-05-30T21:41:12Z</dc:date>
    </item>
  </channel>
</rss>

