tags:

views:

79

answers:

2

Hello, I am trying to compile a slight part of second life library. Specifically, it is the llcommon part. I compiled it in Windows System with VS9. I failed and the compiler said it cannot recognize '_Ios_Openmode' as a member of 'std'

The corresponding code is as following:

explicit llifstream(const std::string& _Filename, std::_Ios_Openmode _Mode = in)
 : std::ifstream(_Filename.c_str(), _Mode)
{  
}

Can anyone help me figure out what the problem is, should I change my compiler configuration or something else?

+2  A: 

I think it's meant to be std::ios::openmode.

Michael Krelin - hacker
Really? But the code is written by Linden Lab. I think it works. Is it good to modify the original code?
xiao
Perhaps it meant for different implementation of standard c++ library. The code being written by Linden Lab is not exempt of weirdness;-) I don't know if it's a good idea to modify the code, but if you want to make it work and have no other ways, then why not? ;-) Perhaps you can work around it by puting `namespace std { typedef ios::openmode _Ios_Openmode; }` instead ;-) Doubt if it's any better. And you need to confirm it fixes the issue first, anyway.
Michael Krelin - hacker
And yes, although sbi doesn't mention the solution, his referring to it as a bug is quite valid.
Michael Krelin - hacker
@hacker: I didn't repeat the solution as you already wrote it. I added a link to your posting, so that this is clearer. Oh, and since you are correct, +1. `:)`
sbi
sbi, I just commented about your answer so that the fact that it's a bug is mentioned in my answer (for the unlikely event of it being accepted) and the credit is given ;-)
Michael Krelin - hacker
+1  A: 

_Ios_Openmode seems to be an internal type of some std lib implementation (the style looks like Dinkumware to me, but I'm not sure) that shouldn't be used outside of that implementation. If it is used somewhere else, it's a bug, plain and simple.

If you can fix this yourself, then by all means do it, but you should report a bug to them.

sbi