|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm trying to compile some ten-year-old code. It used to work fine on my Solaris machine, but I've recently switched to Fedora 7 and am having to re-install the lot. This line doesn't pass compilation: logfile->seekp(-4,(ios::seek_dir)1); on the grounds that `seek_dir' is not a member of `std::ios'. If it's relevant, I'm trying to compile it with g++34 -Wno-deprecated I tried various things, like not qualifying seek_dir at all, or qualifying with std::ios, both combined with putting (exactly) one of these lines at the top: using ios::seek_dir; using std::ios::seek_dir; using std::ios; #include <ios> but to no avail. The advice I can get from random places on the web says that seek_dir should be qualified with ios:: but the question is, then, how to I tell the compiler to bring ios into scope? Any greatly appreciated... |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Irina Voiculescu wrote:
> I'm trying to compile some ten-year-old code. It used > to work fine on my Solaris machine, but I've recently > switched to Fedora 7 and am having to re-install the > lot. > > This line doesn't pass compilation: > > logfile->seekp(-4,(ios::seek_dir)1); > > on the grounds that `seek_dir' is not a member of > `std::ios'. If it's relevant, I'm trying to compile it > with > > g++34 -Wno-deprecated > > I tried various things, like not qualifying seek_dir at > all, or qualifying with std::ios, both combined with > putting (exactly) one of these lines at the top: > > using ios::seek_dir; > using std::ios::seek_dir; > using std::ios; > #include <ios> > > but to no avail. > > The advice I can get from random places on the web says > that seek_dir should be qualified with ios:: but the > question is, then, how to I tell the compiler to bring > ios into scope? > > > Any greatly appreciated... Whip up a small example that has 'ios::seek_dir' (or better 'std::ios_base::seek_dir') and try it on the online Comeau trial. Get it to compile there, then copy to your machine and see if it compiles. If it doesn't, you've simply got a non-compliant compiler, or a buggy one (is there any difference?) V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
It turns out ios::seek_dir has now become ios::seekdir On Fri, 22 Feb 2008, Irina Voiculescu wrote: > I'm trying to compile some ten-year-old code. It used to work fine on my > Solaris machine, but I've recently switched to Fedora 7 and am having to > re-install the lot. > > This line doesn't pass compilation: > > logfile->seekp(-4,(ios::seek_dir)1); > > on the grounds that `seek_dir' is not a member of `std::ios'. If it's > relevant, I'm trying to compile it with > > g++34 -Wno-deprecated > > I tried various things, like not qualifying seek_dir at all, or qualifying > with std::ios, both combined with putting (exactly) one of these lines at the > top: > > using ios::seek_dir; > using std::ios::seek_dir; > using std::ios; > #include <ios> > > but to no avail. > > The advice I can get from random places on the web says that seek_dir should > be qualified with ios:: but the question is, then, how to I tell the compiler > to bring ios into scope? > > > Any greatly appreciated... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Feb 22, 7:23 pm, Irina Voiculescu <ir...@comlab.ox.ac.uk> wrote:
> I'm trying to compile some ten-year-old code. It used > to work fine on my Solaris machine, but I've recently > switched to Fedora 7 and am having to re-install the > lot. > This line doesn't pass compilation: > logfile->seekp(-4,(ios::seek_dir)1); > on the grounds that `seek_dir' is not a member of > `std::ios'. I'd start by asking what this code is supposed to do. It has no defined meaning according to the standard, and didn't have any in any of the pre-standard implementations I used. (According to the standard, the type's name is std::ios::seekdir, but casting an arbitrary numerical value to that type has no defined meaning.) > The advice I can get from random places on the web says > that seek_dir should be qualified with ios:: but the > question is, then, how to I tell the compiler to bring > ios into scope? ios is in scope std. But the problem here is much deeper. The only legal values for the second argument of ostream::seekp are std::ios::beg, std::ios::cur or std::ios::end. Anything else is simply undefined behavior. -- James Kanze (GABI Software) email:james.kanze@gmail.com Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 |
|
![]() |
| Outils de la discussion | |
|
|