tags:

views:

128

answers:

1

Friends

On HP-UX box when Iam passing a string object to function Im getting the following below error

Error 422: "../header/Handler.h", line 24 # 'string' is used as a type, but has not been defined as a type. Perhaps you meant 'String' as in class String

["/opt/aCC/include/SC/String.h", line 66].

        int populateBindingHandle(rpc_if_handle_t p_if_spec, string p_cell_name);

why would I get an error to use String.h not

how does a declaration String newstr;

different from

string newstr; ??

Many Thanks

+2  A: 

Looks like there is a String class in the header mentioned by the compiler. The compiler thinks you made a typo.

If you want to use STL strings use the following:

#include <string>

int populateBindingHandle(rpc_if_handle_t p_if_spec, std::string ...)

or have a using declaration somewhere:

using std::string;

int populateBindingHandle(rpc_if_handle_t p_if_spec, std::string ...)

Note, the old-style headers have been deprecated, i.e. you should no longer use #include <string.h>

dirkgently
Thanks What about String.h ?
ronan
Looks like some old `aCC` specific library class. I don't think you'd need that.
dirkgently