STL headers in VC.Net

W

Wei-Chao Hsu

I have an old C++ program that used "complex.h". It appeared an error when
it was recompiled by MS VC.NET 2003. The compiler could not find the file
"complex.h", but it will be fine if <complex> and "using namespace std" were
used. There is no problem if it is compiled by Borland CBuilderX. I don't
want to modify the program because it will be a hard work. Any idea?

Dennis
 
M

Moonlit

Hi,

".h" is old all the STL stuff has been renamed to <vector> <list>, <sstream>
for stringstream stuff etc.
It is recommended to change it or just compile with an old compiler. This is
true for both VC and g++. Also you have to include "using namespace std" or
add "std::".

(Note that stringstream has changed a bit previously you had to call a
routine explicitely with zero to deallocate memory, now it is done
automatically).

In short, either compile with an old compiler or modify the program ( a
simple but job but it might still be a lot of work).

Regards, Ron AF Greve.
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Wei-Chao Hsu said:
I have an old C++ program that used "complex.h". It appeared an error
when it was recompiled by MS VC.NET 2003. The compiler could not find the
file "complex.h", but it will be fine if <complex> and "using namespace
std" were used. There is no problem if it is compiled by Borland
CBuilderX. I don't want to modify the program because it will be a hard
work. Any idea?

Write a complex.h file with this:

#include <complex>
using std::complex;
 
G

Greg Comeau

I have an old C++ program that used "complex.h". It appeared an error when
it was recompiled by MS VC.NET 2003. The compiler could not find the file
"complex.h", but it will be fine if <complex> and "using namespace std" were
used. There is no problem if it is compiled by Borland CBuilderX. I don't
want to modify the program because it will be a hard work. Any idea?

If you really must, then why not create a complex.h or your own
which #include's <complex> and then using namespace std's it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,427
Latest member
HildredDic

Latest Threads

Top