<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.1</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04(PC)    JestonTk1  JestonTX1</li>
<li>Compiler =&gt; gcc</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Question Projection: YOLO-Darknet      <a href="https://pjreddie.com/darknet/install/" rel="nofollow">https://pjreddie.com/darknet/install/</a><br>
Error occurred when using cvRound function</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Just run make</p>
<p dir="auto">obj/image.o：In Function ‘cvPointFrom32f’：<br>
/usr/local/include/opencv2/core/types_c.h:929：undefined reference to ‘cvRound’<br>
/usr/local/include/opencv2/core/types_c.h:930：undefined reference to ‘cvRound’<br>
obj/image.o：In Function ‘cvReadInt’：<br>
/usr/local/include/opencv2/core/core_c.h:2318：undefined reference to ‘cvRound’<br>
obj/image.o：In Function ‘cvEllipseBox’：<br>
/usr/local/include/opencv2/imgproc/imgproc_c.h:1041：undefined reference to ‘cvRound’<br>
/usr/local/include/opencv2/imgproc/imgproc_c.h:1042：undefined reference to ‘cvRound’<br>
obj/darknet.o:/usr/local/include/opencv2/core/types_c.h:929: more undefined reference to ‘cvRound’ follow</p>
<h5 dir="auto">Solution</h5>
<p dir="auto">Modify the cvdef.h  by adding the follow codes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/*************************************************************************************\
*                                    Test add fast_math.hpp by devin                  *
\*************************************************************************************/

#ifndef __cplusplus
#include &quot;opencv2/core/fast_math.hpp&quot;
#endif
"><pre class="notranslate"><code class="notranslate">/*************************************************************************************\
*                                    Test add fast_math.hpp by devin                  *
\*************************************************************************************/

#ifndef __cplusplus
#include "opencv2/core/fast_math.hpp"
#endif

</code></pre></div>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.2</li>
<li>Operating System / Platform =&gt; linux Ubuntu 16.04 64 Bit</li>
<li>Compiler =&gt; gcc</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I have recently installed opencv 3.2 in ubuntu 16.04 system and tried to run a C code using opencv library. The code is not compiling because of the following issue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/tmp/ccwgquWQ.o: In function `cvPointFrom32f':
try.c:(.text+0x54d): undefined reference to `cvRound'
try.c:(.text+0x563): undefined reference to `cvRound'
/tmp/ccwgquWQ.o: In function `cvReadInt':
try.c:(.text+0xe68): undefined reference to `cvRound'
/tmp/ccwgquWQ.o: In function `cvEllipseBox':
try.c:(.text+0x10d4): undefined reference to `cvRound'
try.c:(.text+0x10f6): undefined reference to `cvRound'
collect2: error: ld returned 1 exit status"><pre class="notranslate"><code class="notranslate">/tmp/ccwgquWQ.o: In function `cvPointFrom32f':
try.c:(.text+0x54d): undefined reference to `cvRound'
try.c:(.text+0x563): undefined reference to `cvRound'
/tmp/ccwgquWQ.o: In function `cvReadInt':
try.c:(.text+0xe68): undefined reference to `cvRound'
/tmp/ccwgquWQ.o: In function `cvEllipseBox':
try.c:(.text+0x10d4): undefined reference to `cvRound'
try.c:(.text+0x10f6): undefined reference to `cvRound'
collect2: error: ld returned 1 exit status
</code></pre></div>
<p dir="auto">I have asked a question related to this in stackoverflow and I got the response saying that, its a bug present in opencv3.2. [http://stackoverflow.com/questions/42918747/yolo-c-compilation-failure-with-debug-1]</p>
<p dir="auto"><strong>The reason for calling it as a bug is as follows:</strong><br>
CvRound function has bee defines in types_c.h in opencv2  whereas in opencv3 its not been defined in types_c.h but in core/fast_math.hpp. Despite being not defined in types_c.h its still being called in types_c.h, core_c.h and imgproc_c.h without any reference to fast_math.hpp</p>
<p dir="auto">I have tried including the "fast_math.hpp" path (#include core/fast_math.hpp) in types_c.h, core_c.h and imgproc_c.h but it didn't solve the issue.</p>
<p dir="auto">Kindly, look into this issue and get it resolved as early as possible</p>