<?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>multiple definition of `SWI2_EGU2_IRQHandler&amp;#39; (when trying to add NFC support to light_switch_server Bluetooth Mesh example)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42672/multiple-definition-of-swi2_egu2_irqhandler-when-trying-to-add-nfc-support-to-light_switch_server-bluetooth-mesh-example</link><description>Hi, 
 I am working on a Bluetooth Mesh project in which I am trying to add support for NFC, but I get the following error &amp;quot; error: multiple definition of `SWI2_EGU2_IRQHandler&amp;#39; &amp;quot;, which occurs in &amp;lt;MESH_SDK_2.2&amp;gt;/common/src/mesh_softdevice_init.c:62. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Jan 2019 18:59:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42672/multiple-definition-of-swi2_egu2_irqhandler-when-trying-to-add-nfc-support-to-light_switch_server-bluetooth-mesh-example" /><item><title>RE: multiple definition of `SWI2_EGU2_IRQHandler' (when trying to add NFC support to light_switch_server Bluetooth Mesh example)</title><link>https://devzone.nordicsemi.com/thread/166359?ContentTypeID=1</link><pubDate>Thu, 17 Jan 2019 18:59:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e634307-b940-4482-94c0-3ec584e028ac</guid><dc:creator>f0corner</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Thank you for helping me out!&lt;/p&gt;
&lt;p&gt;You are right to say that it&amp;#39;s a Linker error (not compiler), and that the error is not specific to Nordic.&lt;/p&gt;
&lt;p&gt;I followed your advice and investigated further to find out what the problem was:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the Mesh SDK example for the Generic OnOff Server (without Proxy feature), the SoftDevice is initialized using the&amp;nbsp;&lt;strong&gt;mesh_softdevice_init()&lt;/strong&gt; function, which comes from&amp;nbsp;&lt;strong&gt;mesh_softdevice_init.c&lt;/strong&gt;, which is where&amp;nbsp;&lt;strong&gt;SWI2_EGU2_IRQHandler&lt;/strong&gt; gets defined first.&lt;/li&gt;
&lt;li&gt;But when I added support for NFC, the latter needed &lt;strong&gt;nrf_sdh.c&lt;/strong&gt; (among other things), which&amp;nbsp;is also defining&amp;nbsp;&lt;strong&gt;SWI2_EGU2_IRQHandler&lt;/strong&gt; (and&amp;nbsp;performing other tasks&amp;nbsp;similar to what&amp;nbsp;&lt;strong&gt;mesh_softdevice_init.c&amp;nbsp;&lt;/strong&gt;does).&lt;/li&gt;
&lt;li&gt;So to solve the issue, I removed &lt;strong&gt;mesh_softdevice_init.c&lt;/strong&gt; from my &lt;strong&gt;CMakeLists.txt&lt;/strong&gt;, and, in &lt;strong&gt;main.c&lt;/strong&gt;, I replaced the call to &lt;strong&gt;mesh_softdevice_init()&lt;/strong&gt; with&amp;nbsp;&lt;strong&gt;nrf_sdh_enable_request()&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now it works!&lt;/p&gt;
&lt;p&gt;Once more, thank you for your advice. A+&lt;/p&gt;
&lt;p&gt;Frank&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multiple definition of `SWI2_EGU2_IRQHandler' (when trying to add NFC support to light_switch_server Bluetooth Mesh example)</title><link>https://devzone.nordicsemi.com/thread/166298?ContentTypeID=1</link><pubDate>Thu, 17 Jan 2019 15:10:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:213db564-8d68-41e7-824e-41976a516279</guid><dc:creator>awneil</dc:creator><description>[quote userid="27166" url="~/f/nordic-q-a/42672/multiple-definition-of-swi2_egu2_irqhandler-when-trying-to-add-nfc-support-to-light_switch_server-bluetooth-mesh-example"] I was wondering if&amp;nbsp;anyone had experienced this error (&lt;strong&gt;&lt;em&gt;error:&amp;nbsp;multiple definition of `SWI2_EGU2_IRQHandler&amp;#39; )&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;in a similar context,[/quote]
&lt;p&gt;Yes:&amp;nbsp; it is a general &amp;#39;C&amp;#39; thing - nothing specific to Nordic.&lt;/p&gt;
&lt;p&gt;The error means what it says - you have multiple (ie, more than one) definitions of&amp;nbsp;&lt;em&gt;SWI2_EGU2_IRQHandler&lt;/em&gt;&lt;/p&gt;
[quote userid="27166" url="~/f/nordic-q-a/42672/multiple-definition-of-swi2_egu2_irqhandler-when-trying-to-add-nfc-support-to-light_switch_server-bluetooth-mesh-example"]&amp;nbsp;I am unable to compile (because of the error above).[/quote]
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;em&gt;Are you sure it&amp;#39;s a compiler error - not a Linker error ?&lt;/em&gt;&lt;strong&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
[quote userid="27166" url="~/f/nordic-q-a/42672/multiple-definition-of-swi2_egu2_irqhandler-when-trying-to-add-nfc-support-to-light_switch_server-bluetooth-mesh-example"]how that error could be fixed[/quote]
&lt;p&gt;Remove the excess definition(s)!&lt;/p&gt;
&lt;p&gt;You haven&amp;#39;t mentioned what toolchain &amp;amp; IDE you&amp;#39;re using, but they do usually tell you where all the definitions were found - so you need to look through them, and decide which to keep, and which to remove.&lt;/p&gt;
&lt;p&gt;failing that, just do a search through your project for all occurrences of &amp;quot;&lt;strong&gt;&lt;em&gt;SWI2_EGU2_IRQHandler&lt;/em&gt;&lt;/strong&gt;&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>