#77 bad include in manualGrip.cc

closed-fixed
Brian Gerkey
5
2004-07-23
2004-07-22
Anonymous
No

Player 1.5 does not fully compile on my machine right
out of the distribution.

My machine:
2.4.20 smp kernel, 2 processors, ungodly amounts of
RAM, gcc 2.96, glibc 2.2.5

Problem:
examples/c++/manualGrip.cc does not compile

Errors:
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../server
-I../../server -I../../client_libs/c
-I../../client_libs/c++ -g -O2 -c manualGrip.cc
manualGrip.cc: In function `int main (int, char **)':
manualGrip.cc:113: `::string' undeclared (first use here)
manualGrip.cc:113: parse error before `;'
manualGrip.cc:114: `str' undeclared (first use this
function)
manualGrip.cc:114: (Each undeclared identifier is
reported only once
for each function it appears in.)
make: *** [manualGrip.o] Error 1

Solution:
I am not a c++ programmer (pure C for me) so I just
googled for the error, and came up with somebody else
who had a similar problem with a different peice of
software.

The reply was that it was incorrect to
#include<string.h>
in c++; but that rather one should
#include<string>

manualGrip.cc does #include<string.h>, rather than
<string>.
I don't understand the whats and whys of this, but when
I removed the .h, it did fix the problem.

-- Jason Fleischer
fleischer@nsi.edu

Discussion

  • Brian Gerkey
    Brian Gerkey
    2004-07-23

    Logged In: YES
    user_id=211013

    Thanks for the tip. Things like <string> vs. <string.h>
    mystify me...

    Anyway, I've made fix in CVS.

    brian.

     
  • Brian Gerkey
    Brian Gerkey
    2004-07-23

    • status: open --> closed-fixed