Issue 30 in v8-juice: Default constructor error for WHIO StdI/OStream classes

9 views
Skip to first unread message

v8-j...@googlecode.com

unread,
Dec 19, 2011, 1:48:08 AM12/19/11
to v8-juic...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 30 by bionicba...@gmail.com: Default constructor error for WHIO
StdI/OStream classes
http://code.google.com/p/v8-juice/issues/detail?id=30

What steps will reproduce the problem?
1) Trying to compile the WHIO plugin for V8-convert.
2) Compiling error with MSVC. Not sure if this is an MSVC issue or a
general standards issue.

Compiler complains that there is no appropriate default constructor for
classes such as StdOStream in whio_amalgamation_cpp.cpp

What is the expected output? What do you see instead?
Expected output is that the constructor uses the correct default
constructor for std::ostream or std::istream. Example constructor looks
like:

StdOStream::StdOStream( whio_stream * proxy, bool ownsWh, uint32_t
bufferSize )
: m_buf( *this, proxy, ownsWh, bufferSize )
{
}

The following kills the compiler error:

StdOStream::StdOStream( whio_stream * proxy, bool ownsWh, uint32_t
bufferSize )
: m_buf( *this, proxy, ownsWh, bufferSize )
, std::ostream(0)
{
}

However, I don't know if using ostream(0) is a problematic default
construction? This may not be the solution to the problem even if the
compiler error goes away.

Exact compiler error:

.\cvv8\addons\whio\whio_amalgamation_cpp.cpp(600) : error
C2512: 'std::basic_ostream<_Elem,_Traits>' : no appropriate default
constructor available
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]

What version of the product are you using? On what operating system?

MSVC 9 (2008) on Windows 7 x64

Please provide any additional information below.

I'm not sure if this is the fault of MSVC or a standards problem. MSVC
uses basic_ostream for the std::stream that the classes in question
complain about:

http://msdn.microsoft.com/en-us/library/3at5becw

It seems that it is the same for GCC:

http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/classstd_1_1basic__ostream.html

Note: I'm no expert, but this is just what I've found.

v8-j...@googlecode.com

unread,
Dec 19, 2011, 1:47:50 PM12/19/11
to v8-juic...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 30 by sgb...@gmail.com: Default constructor error for

Hi!

First off, thank you for the detailed report :).

The whio code will "almost certainly not" compile on Windows because it
makes some small use of Posix APIs which aren't available on Windows, e.g.
signal handling. The majority of it "should" compile on Windows but is
untested, and some of the functionality (e.g. EPFS) won't build on Windows
without some more #ifdefs (and someone to test them - i don't have Windows).

As for the stream constructor - i can't say off hand whether i hosed whio's
use of the stream ctor, but i very well may have. i just happen to have an
excellent book about the i/o stream library on my shelf and will
clarify/fix this.

However... i unfortunately cannot commit to doing this right now. My local
cvv8 does not compile because Coen and i are in the middle of removing some
rather invasive code and my work (and malicious system crackers) have kept
me from doing any coding the past 8 weeks or so. It is very unlikely that i
will be able to spend any time fixing it for at least another 10 days or
so. i apologize for that, but the timing is particularly bad for me.

In any case, you'll get a mail from google when this ticket has been
updated.

v8-j...@googlecode.com

unread,
Dec 19, 2011, 7:29:24 PM12/19/11
to v8-juic...@googlegroups.com

Comment #2 on issue 30 by bionicba...@gmail.com: Default constructor error

No problem! Eventually, I got it to compile on Windows after applying
those constructor fixes and using a lot of compatibility include files to
imitate POSIX. I really wanted some file-IO functionality in my little v8
shell. It does what I want for now (just simple text readline and write);
however, I haven't tested the other features extensively to see if using a
null stream is proper.

I can also provide the includes/source-of-includes and documentation on how
to make the plugin work with MSVC. With exception to getopt.h/.c most of
the compatibility fixes comprise providing defines, or can just be gated
away.

Thanks!

v8-j...@googlecode.com

unread,
Dec 20, 2011, 11:15:58 AM12/20/11
to v8-juic...@googlegroups.com

Comment #3 on issue 30 by sgb...@gmail.com: Default constructor error for

Hi, Badger!

Any additions/fixes/patches are of course happily received! Just attach
them to the report or feel free to email them to me (sgbeal googlemail.com)
or our list (v8-juic...@googlegroups.com). i will be out of town much
of the next 10 days but will get around to the stream constructor stuff
(and any additional code you have) as soon as i get some time to hack.
Unfortunately, my employers consider their PHP/JS code to be much more
important than my C++ code :(.

v8-j...@googlecode.com

unread,
Feb 15, 2012, 2:43:46 PM2/15/12
to v8-juic...@googlegroups.com
Updates:
Status: Started

Comment #4 on issue 30 by sgb...@gmail.com: Default constructor error for

The fix is in place in the whio source tree but needs to be ported in here
(hopefully this coming weekend).

v8-j...@googlecode.com

unread,
Feb 17, 2012, 3:26:21 AM2/17/12
to v8-juic...@googlegroups.com
Updates:
Status: Fixed

Comment #5 on issue 30 by sgb...@gmail.com: Default constructor error for

Badger's patches were committed in r2181.

Reply all
Reply to author
Forward
0 new messages