MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #8239 All Revisions ] Back to Issue ]
Summary 0008239: Foundation Classes - directive "using namespace std" doesn't allow to build application with OCC and other 3rd party libraries
Revision 2012-01-19 14:38 by atp
Description If custom application uses the OCC and other 3rd party library (for example VTK
or Qt) based on ANSI streams then compiler fails during determination stream
symbols: istream, ostream, ... (compiler error C2872). Directive "using
namespace std" export the all symbol from std namespace into global scope.
Possible solution is not to use directive "using namespace std", but explicitly
specify STL stream symbols (std::ostream) and define preprocessor directive as
namespace prefix name for it.

Enclosed archive (OCC_Streams.tgz) contains example which illustrate proposed
solution with preprocessor directive OCC_STREAM_STD.

Do not hestitate to contact me.

Regards,
STV
Revision 2007-07-06 16:22 by atp
Description If custom application uses the OCC and other 3rd party library (for example VTK
or Qt) based on ANSI streams then compiler fails during determination stream
symbols: istream, ostream, ... (compiler error C2872). Directive "using
namespace std" export the all symbol from std namespace into global scope.
Possible solution is not to use directive "using namespace std", but explicitly
specify STL stream symbols (std::ostream) and define preprocessor directive as
namespace prefix name for it.

Enclosed archive (OCC_Streams.tgz) contains example which illustrate proposed
solution with preprocessor directive OCC_STREAM_STD.

Do not hestitate to contact me.

Regards,
Sergey TELKOV


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker