<?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>Compiling error in C++</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117734/compiling-error-in-c</link><description>I am using download_client library in C++ project. I have to include coap.h but when I compile I get this error: 
 C:/ncs/v2.7.0/zephyr/include/zephyr/net/coap.h:744:16: error: invalid conversion from &amp;#39;int&amp;#39; to &amp;#39;coap_block_size&amp;#39; [-fpermissive] 
 I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jan 2025 14:24:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117734/compiling-error-in-c" /><item><title>RE: Compiling error in C++</title><link>https://devzone.nordicsemi.com/thread/517266?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 14:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d09b6621-adb4-4ae8-b7d5-92338cb84057</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You can have a look at this&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/c4bf917549f64a144fe4e696294918e29cf9266c"&gt;commit&lt;/a&gt;&amp;nbsp;which adds explicit casting.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling error in C++</title><link>https://devzone.nordicsemi.com/thread/517144?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 08:29:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4464f01a-6382-40f7-99ab-c1ec3aabc0c0</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;I mean the c library returns an enum but the declaration is int. C++ marks it as error.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling error in C++</title><link>https://devzone.nordicsemi.com/thread/517078?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2025 16:40:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e776efa9-7866-4681-bb24-ca432023f2a3</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;C++ version 12.2.0&lt;/p&gt;
&lt;p&gt;As full log, do you mean this?:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;In file included from C:/ncs/modem_and_sensor/src/ClientLibrary/CDownloadClient.h:5,&lt;br /&gt; from C:/ncs/modem_and_sensor/src/ClientLibrary/CDownloadClient.cpp:1:&lt;br /&gt;C:/ncs/v2.7.0/zephyr/include/zephyr/net/coap.h: In function &amp;#39;coap_block_size coap_bytes_to_block_size(uint16_t)&amp;#39;:&lt;br /&gt;C:/ncs/v2.7.0/zephyr/include/zephyr/net/coap.h:744:16: error: invalid conversion from &amp;#39;int&amp;#39; to &amp;#39;coap_block_size&amp;#39; [-fpermissive]&lt;br /&gt; 744 | return sz;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; Adding this in my CMakeLists.txt&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;target_compile_options(app PRIVATE -fpermissive)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;the error becomes a warning, so I downgrade an error to a simple warning.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling error in C++</title><link>https://devzone.nordicsemi.com/thread/516989?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2025 13:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23d79177-f356-4569-b4db-d4236d17ecf6</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I am using download_client library in C++ project. I have to include coap.h[/quote]
&lt;p&gt;Can you show how you do this?&lt;/p&gt;
[quote user=""]&lt;p&gt;when I compile I get this error:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;C:/ncs/v2.7.0/zephyr/include/zephyr/net/coap.h:744:16: error: invalid conversion from &amp;#39;int&amp;#39; to &amp;#39;coap_block_size&amp;#39; [-fpermissive]&lt;/p&gt;[/quote]
&lt;p&gt;Can you provide full log which shows the error?&lt;/p&gt;
[quote user=""]my question is if exists one way to compile without downgrading c++ checks.[/quote]
&lt;p&gt;Can you rephrase this sentence? What do you refer to as &amp;quot;downgrading C++ checks&amp;quot;?&lt;br /&gt;&lt;br /&gt;Which C++ version do you use?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>