Note that there are some explanatory texts on larger screens.

plurals
  1. POundefined reference to cv::fontQt
    text
    copied!<p>I get the following linker error :</p> <pre><code>/tmp/cclOj2K8.o: In function `main': fontTest.cpp:(.text+0x96): undefined reference to `cv::fontQt(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int, cv::Scalar_&lt;double&gt;, int, int, int)' fontTest.cpp:(.text+0x151): undefined reference to `cv::addText(cv::Mat const&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, cv::Point_&lt;int&gt;, CvFont)' collect2: ld returned 1 exit status </code></pre> <p>To compile I type:</p> <pre><code>gcc `pkg-config --cflags opencv` `pkg-config --libs opencv` -o fontTest fontTest.cpp </code></pre> <p>I do have openCV 2.3.1 installed.</p> <p>Here is my source code (fontTest.cpp):</p> <pre><code>#include &lt;cv.h&gt; #include &lt;highgui.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string&gt; using namespace cv; int main(int argc, char* argv[]) { Mat img1; CvFont font = fontQt("Times"); addText( img1, "Hello World !", Point(50,50), font); imshow("image", img1); waitKey(0); } </code></pre> <p>The output of the pkg-config are:</p> <pre><code>-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -I/usr/local/include/opencv -I/usr/local/include </code></pre> <p>What am I missing?</p> <p>Thanks for the help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload