Yes Aaron, the function was defined in .h, but the implementation in .cpp didn&#39;t have the &quot;Executor::&quot; prefix. Now, everything is working fine.<div><br></div><div>Thanks for your attention!<br><br><div class="gmail_quote">

On Tue, Apr 3, 2012 at 3:51 PM,  <span dir="ltr">&lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<font face="sans-serif">Did you define Executor::runCommand(...)?</font>
<br>
<br><font face="sans-serif">---<br>
Aaron Wright</font>
<br>
<br>
<br>
<br>
<br><font size="1" color="#5f5f5f" face="sans-serif">From:      
 </font><font size="1" face="sans-serif">Mauricio Klein &lt;<a href="mailto:mauricio.klein.msk@gmail.com" target="_blank">mauricio.klein.msk@gmail.com</a>&gt;</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">To:      
 </font><font size="1" face="sans-serif"><a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Date:      
 </font><font size="1" face="sans-serif">04/03/2012 11:49 AM</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Subject:    
   </font><font size="1" face="sans-serif">Re: [CMake]
String error Cmake</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Sent by:    
   </font><font size="1" face="sans-serif"><a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a></font>
<br>
<hr noshade><div class="HOEnZb"><div class="h5">
<br>
<br>
<br><font size="3">One more information:</font>
<br>
<br><font size="3">Andreas, i&#39;m compiling at least 10 .cpp codes, many of
them using string without problems.</font>
<br>
<br><font size="3">The error is occurring just in this function, but i&#39;ve
assured that string libraries are included.<br>
</font>
<br><font size="3">On Tue, Apr 3, 2012 at 3:46 PM, Mauricio Klein &lt;</font><a href="mailto:mauricio.klein.msk@gmail.com" target="_blank"><font size="3" color="blue"><u>mauricio.klein.msk@gmail.com</u></font></a><font size="3">&gt;
wrote:</font>
<br><font size="3">The complete error is the following:</font>
<br>
<br><font size="3">----------------------------</font>
<br><font size="3">CMakeFiles/MonitoraITSchedulerAgent.dir/SourceCode/src/Executor.cpp.o:
In function `Executor::execute(Service*, unsigned int)&#39;:</font>
<br><font size="3">Executor.cpp:(.text+0x8c): undefined reference to `Executor::runCommand(char
const*, unsigned int, std::basic_string&lt;char, std::char_traits&lt;char&gt;,
std::allocator&lt;char&gt; &gt;&amp;)&#39;</font>
<br><font size="3">CMakeFiles/MonitoraITSchedulerAgent.dir/SourceCode/src/ServiceProvider.cpp.o:
In function `ServiceProvider::sendDiscovery()&#39;:</font>
<br><font size="3">ServiceProvider.cpp:(.text+0x9b6): undefined reference
to `Executor::runCommand(char const*, unsigned int, std::basic_string&lt;char,
std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;)&#39;</font>
<br><font size="3">collect2: ld returned 1 exit status</font>
<br><font size="3">make[2]: *** [MonitoraITSchedulerAgent] Error 1</font>
<br><font size="3">make[1]: *** [CMakeFiles/MonitoraITSchedulerAgent.dir/all]
Error 2</font>
<br><font size="3">make: *** [all] Error 2</font>
<br><font size="3">----------------------------</font>
<br>
<br><font size="3">The function header that is generating the error is:</font>
<br>
<br><font size="3">----------------------------</font>
<br><font size="3">int runCommand(const char* command, unsigned int timeout,
string&amp; output);</font>
<br><font size="3">----------------------------</font>
<br>
<br><font size="3">I&#39;ve already included &quot;&lt;string&gt;&quot; and declared
&quot;using namespace std&quot;.</font>
<br>
<br><font size="3">Thanks for any reply!</font>
<br><font size="3"><br>
</font>
<br><font size="3">On Tue, Apr 3, 2012 at 3:37 PM, Andreas Pakulat &lt;</font><a href="mailto:apaku@gmx.de" target="_blank"><font size="3" color="blue"><u>apaku@gmx.de</u></font></a><font size="3">&gt;
wrote:</font>
<br><font size="3">On 03.04.12 14:26:01, Mauricio Klein wrote:<br>
&gt; Hello fellows!<br>
&gt;<br>
&gt; I&#39;m compiling my code using CMake and i&#39;m receiving a linker error
like<br>
&gt; this:<br>
&gt; std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt;
&gt;<br>
</font>
<br><font size="3">When you get errors, post the complete error message and
not just a<br>
part. The above is completely useless.</font>
<br><font size="3"><br>
&gt; After few researches on the internet, i realized that this kind of
error<br>
&gt; occurs when compiling a C++ code with GCC, instead G++.<br>
&gt;<br>
&gt; My question is: how can i force CMake to use G++ as default compiler?<br>
</font>
<br><font size="3">CMake already does this when you feed it c++ sources.
So check you<br>
project wether you maybe disabled C++ support, or wether you maybe have<br>
C++ code in .c files.<br>
<br>
Andreas<br>
<br>
--<br>
<br>
Powered by </font><a href="http://www.kitware.com/" target="_blank"><font size="3" color="blue"><u>www.kitware.com</u></font></a><font size="3"><br>
<br>
Visit other Kitware open-source projects at </font><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><font size="3" color="blue"><u>http://www.kitware.com/opensource/opensource.html</u></font></a><font size="3"><br>


<br>
Please keep messages on-topic and check the CMake FAQ at: </font><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"><font size="3" color="blue"><u>http://www.cmake.org/Wiki/CMake_FAQ</u></font></a><font size="3"><br>


<br>
Follow this link to subscribe/unsubscribe:</font><font size="3" color="blue"><u><br>
</u></font><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"><font size="3" color="blue"><u>http://www.cmake.org/mailman/listinfo/cmake</u></font></a>
<br><font size="3"><br>
</font>
<br>
<br><font size="3">-- <br>
Best regards,<br>
<br>
Maurício Souza Klein.</font>
<br><font size="3"><br>
</font>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888"><font size="3">-- <br>
Best regards,<br>
<br>
Maurício Souza Klein.</font><tt><font>--<br>
<br>
Powered by </font></tt><a href="http://www.kitware.com" target="_blank"><tt><font>www.kitware.com</font></tt></a></font></span><div class="HOEnZb"><div class="h5"><tt><font><br>
<br>
Visit other Kitware open-source projects at </font></tt><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><tt><font>http://www.kitware.com/opensource/opensource.html</font></tt></a><tt><font><br>


<br>
Please keep messages on-topic and check the CMake FAQ at: </font></tt><a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"><tt><font>http://www.cmake.org/Wiki/CMake_FAQ</font></tt></a><tt><font><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</font></tt><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"><tt><font>http://www.cmake.org/mailman/listinfo/cmake</font></tt></a>
<br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<br><br>Maurício Souza Klein.<br>
</div>