Problems using c++-STL and OpenCascade-Foundation-Classes

Hi,

i'v got a problem when using classes from the c++-Standard-Template-Library and classes from OpenCascade in the same project.
I'm using VC++6.0 and OpenCascade5.0.

I tried to use

#include
using namespace std;

which results in an error:
tcollection_basicmap.hxx(61) : error C2872: 'ostream' : ambiguous symbol

I found, that Standard_Stream.hxx has old style includes like #include .

1) Can anyone tell me how to solve this problem.

2) Does anybody know if there are plans to change this in OpenCascade? Or will OpenCascade stick to this old-version headerfiles?

Ciao

hhahn

Stephane Routelous's picture

try to include your stl headers before the OpenCASCADE ones.

HTH

mogli's picture

Hi,

@Patrik, @Stephane
Thanks for your Help!!

Still I think using the old headers, which put everything in global namespace isn't good style. "using namespace .." seems better to me, especially in big projects.
Found the thread about c#, and the project which converts the opencascade code.
I still hope this will sometime become standard in Opencascade ( HEY Opencascade-Team! ;-)

Ciao

hhahn

Jonathan Hill's picture

Hi,

I have a set of C# wrapper classes (but not using P/Invoke) which would allow to load in IGES or STEP file and add shapes etc. in .NET using VS 2005.

Jonathan

Patrik Mueller's picture

Hi,

try for example std::list . I don't have problems if avoid the using directive.

HTH,

Patrik