<?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 wchar_t warning when linking with library generated by another toolchain in LPCXpresso IDE FAQs</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/wchar-t-warning-when-linking-with-library-generated-by-another/m-p/475305#M140</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a standard know 'issue' with interworking code compiled with different toolchains, which is a result of the &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Finfocenter.arm.com%2Fhelp%2Findex.jsp%3Ftopic%3D%2Fcom.arm.doc.subset.swdev.abi%2Findex.html"&gt;ARM AEABI documentation&lt;/A&gt; allowing the size of &lt;TT&gt;wchar_t&lt;/TT&gt; to be compiler defined. GCC uses a wchar_t size of 4, but some other toolchains use a size of 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can result in linker warning similar to the one below being generated when building an application with LPCXpresso which links in a library archive or object file generated using another toolchain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding: 5px 10px; background: #eeeeee;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;&lt;TT&gt;c:/nxp/lpcxpresso_7.2.0_153/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: warning: C:\workspace\myproj\src\libextcode.a(code.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail&lt;/TT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless your codebase actually uses wchar types (generally unlikely for most embedded application), then you can solve this problem by simply adding the linker flag "&lt;TT&gt;-no-wchar-size-warning&lt;/TT&gt;" to your LPXpresso project by navigating to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding: 5px 10px; background: #eeeeee;"&gt;&lt;STRONG style="font-size: 12pt; font-family: courier new,courier;"&gt;&lt;TT&gt;Project - Properties - C/C++ Build - Settings - Tool Settings - MCU Linker - Miscellaneous&lt;/TT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and adding "&lt;TT&gt;-no-wchar-size-warning&lt;/TT&gt;" to the "Other options" box. Remember to do this for all Build Configurations (Debug and Release).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;H2 style="font-family: Lato, sans-serif; color: #e66e08; font-size: 18px; background: 0 50% #ffffff;"&gt;See also:&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389048" data-objecttype="1" href="https://community.nxp.com/thread/389048"&gt;&lt;SPAN style="border-bottom-color: transparent; color: #7bb1db; border-bottom-width: 1px; border-bottom-style: solid;"&gt;Linking with third party libraries&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2016 05:42:29 GMT</pubDate>
    <dc:creator>lpcware-support</dc:creator>
    <dc:date>2016-04-01T05:42:29Z</dc:date>
    <item>
      <title>wchar_t warning when linking with library generated by another toolchain</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/wchar-t-warning-when-linking-with-library-generated-by-another/m-p/475305#M140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a standard know 'issue' with interworking code compiled with different toolchains, which is a result of the &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Finfocenter.arm.com%2Fhelp%2Findex.jsp%3Ftopic%3D%2Fcom.arm.doc.subset.swdev.abi%2Findex.html"&gt;ARM AEABI documentation&lt;/A&gt; allowing the size of &lt;TT&gt;wchar_t&lt;/TT&gt; to be compiler defined. GCC uses a wchar_t size of 4, but some other toolchains use a size of 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can result in linker warning similar to the one below being generated when building an application with LPCXpresso which links in a library archive or object file generated using another toolchain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding: 5px 10px; background: #eeeeee;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;&lt;TT&gt;c:/nxp/lpcxpresso_7.2.0_153/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: warning: C:\workspace\myproj\src\libextcode.a(code.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail&lt;/TT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless your codebase actually uses wchar types (generally unlikely for most embedded application), then you can solve this problem by simply adding the linker flag "&lt;TT&gt;-no-wchar-size-warning&lt;/TT&gt;" to your LPXpresso project by navigating to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding: 5px 10px; background: #eeeeee;"&gt;&lt;STRONG style="font-size: 12pt; font-family: courier new,courier;"&gt;&lt;TT&gt;Project - Properties - C/C++ Build - Settings - Tool Settings - MCU Linker - Miscellaneous&lt;/TT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and adding "&lt;TT&gt;-no-wchar-size-warning&lt;/TT&gt;" to the "Other options" box. Remember to do this for all Build Configurations (Debug and Release).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;H2 style="font-family: Lato, sans-serif; color: #e66e08; font-size: 18px; background: 0 50% #ffffff;"&gt;See also:&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389048" data-objecttype="1" href="https://community.nxp.com/thread/389048"&gt;&lt;SPAN style="border-bottom-color: transparent; color: #7bb1db; border-bottom-width: 1px; border-bottom-style: solid;"&gt;Linking with third party libraries&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2016 05:42:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/wchar-t-warning-when-linking-with-library-generated-by-another/m-p/475305#M140</guid>
      <dc:creator>lpcware-support</dc:creator>
      <dc:date>2016-04-01T05:42:29Z</dc:date>
    </item>
  </channel>
</rss>

