<font size=2 face="sans-serif">Did you define Executor::runCommand(...)?</font>
<br>
<br><font size=2 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 <mauricio.klein.msk@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">cmake@cmake.org</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">cmake-bounces@cmake.org</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>One more information:</font>
<br>
<br><font size=3>Andreas, i'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've
assured that string libraries are included.<br>
</font>
<br><font size=3>On Tue, Apr 3, 2012 at 3:46 PM, Mauricio Klein <</font><a href=mailto:mauricio.klein.msk@gmail.com><font size=3 color=blue><u>mauricio.klein.msk@gmail.com</u></font></a><font size=3>>
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)':</font>
<br><font size=3>Executor.cpp:(.text+0x8c): undefined reference to `Executor::runCommand(char
const*, unsigned int, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >&)'</font>
<br><font size=3>CMakeFiles/MonitoraITSchedulerAgent.dir/SourceCode/src/ServiceProvider.cpp.o:
In function `ServiceProvider::sendDiscovery()':</font>
<br><font size=3>ServiceProvider.cpp:(.text+0x9b6): undefined reference
to `Executor::runCommand(char const*, unsigned int, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'</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& output);</font>
<br><font size=3>----------------------------</font>
<br>
<br><font size=3>I've already included "<string>" and declared
"using namespace std".</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 <</font><a href=mailto:apaku@gmx.de target=_blank><font size=3 color=blue><u>apaku@gmx.de</u></font></a><font size=3>>
wrote:</font>
<br><font size=3>On 03.04.12 14:26:01, Mauricio Klein wrote:<br>
> Hello fellows!<br>
><br>
> I'm compiling my code using CMake and i'm receiving a linker error
like<br>
> this:<br>
> std::basic_string<char, std::char_traits<char>, std::allocator<char>
><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>
> After few researches on the internet, i realized that this kind of
error<br>
> occurs when compiling a C++ code with GCC, instead G++.<br>
><br>
> 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><font size=3>-- <br>
Best regards,<br>
<br>
Maurício Souza Klein.</font><tt><font size=2>--<br>
<br>
Powered by </font></tt><a href=www.kitware.com><tt><font size=2>www.kitware.com</font></tt></a><tt><font size=2><br>
<br>
Visit other Kitware open-source projects at </font></tt><a href=http://www.kitware.com/opensource/opensource.html><tt><font size=2>http://www.kitware.com/opensource/opensource.html</font></tt></a><tt><font size=2><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: </font></tt><a href=http://www.cmake.org/Wiki/CMake_FAQ><tt><font size=2>http://www.cmake.org/Wiki/CMake_FAQ</font></tt></a><tt><font size=2><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</font></tt><a href=http://www.cmake.org/mailman/listinfo/cmake><tt><font size=2>http://www.cmake.org/mailman/listinfo/cmake</font></tt></a>
<br>