For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

fdstream-problem using ImproveCascade&OpenCascade51

H Hahn's picture


I've got an problem using ImproveCascade with OpenCascade51.

When compiling the draw-workspace I get the error:

..\..\inc\fdstream.hpp(90) : error C2512: 'basic_ostream >' : no appropriate default constructor available
..\..\inc\fdstream.hpp(90) : error C2614: 'fdostream' : illegal member initialization: 'ostream' is not a base or member
..\..\inc\fdstream.hpp(109) : error C2258: illegal pure syntax, must be '= 0'
..\..\inc\fdstream.hpp(109) : error C2252: 'pbSize' : pure specifier can only be specified for functions
..\..\inc\fdstream.hpp(110) : error C2258: illegal pure syntax, must be '= 0'
..\..\inc\fdstream.hpp(110) : error C2252: 'bufSize' : pure specifier can only be specified for functions
..\..\inc\fdstream.hpp(111) : error C2065: 'bufSize' : undeclared identifier
..\..\inc\fdstream.hpp(111) : error C2065: 'pbSize' : undeclared identifier
..\..\inc\fdstream.hpp(111) : error C2057: expected constant expression
..\..\inc\fdstream.hpp(111) : warning C4200: nonstandard extension used : zero-sized array in struct/union
..\..\inc\fdstream.hpp(179) : error C2229: class 'boost::fdistream' has an illegal zero-sized array

I'm using VC++6.0 and the fdstream.hpp from the linked site.

(BTW. fixed the problem with the 'flush'-variable in 5.1 by renaming it to 'aflush'. So I think that coulden't be the problem!? )

Thanks for any help!!



Patrik Mueller's picture


with VC6 I would recommend using STLPort. Perhaps this helps. But I'm not sure if ImproveCascade works with 5.1


H Hahn's picture


just downloaded STL-port and tried it. Still the same error!

Id compiled the lib's, put the stlport folder in my include-path ( first-place ) and the lib folder in my lib path.

Is there anything I missed?



Conrad J Poelman's picture

Hi again,

I don't see any clear answers from looking at your compiler output and the fdstream.hpp file. I've never tried using fdstream.hpp with Visual Studio 6.0. You could try making a separate little one-file project and #include "fdstream.hpp" to see if it compiles under 6.0 when separated from Open Cascade.

It seems strange to me that the fdstream.hpp code uses "std::" in front of everything, but your first error message just says "basic_ostream" has no default constructors instead of saying "std::basic_ostream". I'm pretty sure with MSVS .NET and later, it prints the full namespace qualifier in the error messages, I don't remember if MSVS 6.0 did that or not.

Perhaps Open Cascade 5.1 #defines some macros that are interfering with fdstream.hpp? Hopefully they didn't "#define std", i.e. define std to be nothing, or something crazy like that...

Unfortunately I won't be able to take a look at this myself until later next week. Let me know if you discover anything else.

-- Conrad

H Hahn's picture


I just want to give you an update on the issue.

I'd made the test you suggested ( testproject, which includes fdstream ),
I wasn't able to compile the project, so it seems it's an VC++6.0 problem.
Compiling OpenCascade5.0 give's me the same error, so it definitely not an OC Problem.
Sorry for causing the confusion!

Thanks for your help!



H Hahn's picture


Just got some emails from people with the same problem, asking for help.

Havn't found a good solution jet, and I'm not sure if I understand enough C++-internals to fix the problem.

The workaround I'm using is to avoid the "using namespace ..." directive. Just include the headerfile the normal way. I know it's a bit akward, because you always has to put std:: in front of every declaration ( std::vector aVector; ).

It was anounced the nextversion of OCC will support newSTL headers.
So I'm waiting ;-)

Any other solution is welcome!