@jenya7 said in A console application doesn't support some classes.:
is it better to set aside Object paradigm and write in old school C style?
First to be clear: don't use a C compiler. Even if you are writing procedural code use a C++ compiler. It is much stricter with types which helps you to catch many errors right away.
Also, don't give up on the object paradigm. Don't use it where you don't have to. Though, this is a general guideline: C++ is a multiparadigm language and you should use the best tool for the task, i.e. use objects where it makes sense, use generic programming where it makes sense, use procedural programming where it makes sense, etc. For object oriented programming there is the rule (if you are actually after performance): don't use virtual member functions if you don't have to. If you think you really have to use them then you would have to use function pointers in C instead. Using virtual member functions instead the compiler can in some cases inline the call which it will not be able to do with function pointers. Basically, this means object oriented programming without much inheritance. Prefer std::string over plain C strings: they contain the length and thus will be faster in many scenarios. Use std::vector instead of plain arrays. This will avoid errors in so many places. Avoid raw pointers like the plague. Using smart pointers might use slightly more memory (depends on the smart pointer type and an optional deleter), but it is so worth the hassle of remembering to delete everything yourself. Basically, use RAII wherever you can. You'd be surprised how often C++ can be better optimized than a list of hard-coded C instructions. Then profile and if there is a place that needs tuning, you can try if a more C-like approach actually helps. BTW C++ has the zero-overhead principle: You don't pay a performance penalty for the features you don't use. Be careful, though, which features you use, like in the example with virtual functions.