Note that there are some explanatory texts on larger screens.

plurals
  1. POc++ compile error:expected initializer before ‘<’ token
    primarykey
    data
    text
    <p>I'm trying to compile a c++ program that i wrote myself. And I'm having trouble compiling it.</p> <p>The <strong>quicksort.hpp</strong> file is:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;cmath&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; #include "cv.h" #include "cv.hpp" #include "highgui.h" void print&lt;CvPoint3D32f&gt;(vector&lt;CvPoint3D32f&gt;&amp; input) { for ( int i = 0; i &lt; input.size(); i++) { std::cout &lt;&lt; input[i].y &lt;&lt; " "; } std::cout &lt;&lt; std::endl; } </code></pre> <p>And <strong>test.cpp</strong> is:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;cmath&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; #include "cv.h" #include "highgui.h" #include "quicksort.hpp" int main() { vector&lt;CvPoint3D32f&gt; input; for(int r = 0; r &lt;= 9;r++) { input.push_back(cvPoint3D32f(2.0f+r,2.1f+r,3.1f+r)); } std::cout &lt;&lt; "Input: "; print(input); return 0; } </code></pre> <p>But I'm getting error like this:</p> <pre><code>quicksort.hpp:4: error: expected initializer before ‘&lt;’ token test.cpp: In function ‘int main()’: test.cpp:22: error: ‘print’ was not declared in this scope test.cpp:22: error: expected primary-expression before ‘&gt;’ token </code></pre> <p>Is it possible to kindly help me figure out why I'm getting this error?</p> <p>I'm using Debian Etch(Linux), g++(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) and opencv 0.9.7-4</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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