R
revyakin
Hi all,
I am a scientist, and I've done quite a bit of programming in scripting
languages, e.g. Python, which I used to analyze data. I am more or
less familiar with the concepts of objects, includes, stdin, stdout,
etc. Now I need to do more complex things, like driving step motors,
analyzing streaming video input via pattern recognition, etc... where
speed is important.
A colleague recommended C++. I thought, I'll just start with the hello
world program and will eventually figure it out. So I bought the Intel
compiler (first one to come up in Google) and installed it.
Right away, it said that it needs Microsoft Visual Studio installed as
a prerequisute. I have the microsoft package, but it does not run: the
license has expired. Well, all includes should be there... What's the
point of selling a compiler which requires having one from another
company?
Then I found several versions of the same Hello World programs on the
web. Here's one
#include <iostream.h>
main()
{
cout << "Hello World!";
return 0;
}
Neither Intel's, no MS's could not compile this- iostream.h could not
be in the includes. Fine, I searched my comp for "iostream" and found
that the Microsoft folder has "iostream" w/o the .h extension.
Correcting <iostream.h> to <iostream> gave out an error for "cout".
Finally, I found a code which could be compiled by Intel's (but not
Microsoft's):
#include <iostream>
using std::cout;
int main() {
cout << "Hello World!";
return 0;
}
Don't laugh, it took me an hour to figure it out.
Isn't there any "unified" syntax on C++? I did not find any usable
documentation on it on the web. Or does each company follows its own
syntax? And what's this "here's a compiler for $399, but you've got to
have Microsoft's one first"-deal about? Honestly, I did not expect to
start having all this trouble right at the "Hello World" step. With
Python, I just downloaded the thing and it worked right away (at least
at the hello world step).
I am a scientist, and I've done quite a bit of programming in scripting
languages, e.g. Python, which I used to analyze data. I am more or
less familiar with the concepts of objects, includes, stdin, stdout,
etc. Now I need to do more complex things, like driving step motors,
analyzing streaming video input via pattern recognition, etc... where
speed is important.
A colleague recommended C++. I thought, I'll just start with the hello
world program and will eventually figure it out. So I bought the Intel
compiler (first one to come up in Google) and installed it.
Right away, it said that it needs Microsoft Visual Studio installed as
a prerequisute. I have the microsoft package, but it does not run: the
license has expired. Well, all includes should be there... What's the
point of selling a compiler which requires having one from another
company?
Then I found several versions of the same Hello World programs on the
web. Here's one
#include <iostream.h>
main()
{
cout << "Hello World!";
return 0;
}
Neither Intel's, no MS's could not compile this- iostream.h could not
be in the includes. Fine, I searched my comp for "iostream" and found
that the Microsoft folder has "iostream" w/o the .h extension.
Correcting <iostream.h> to <iostream> gave out an error for "cout".
Finally, I found a code which could be compiled by Intel's (but not
Microsoft's):
#include <iostream>
using std::cout;
int main() {
cout << "Hello World!";
return 0;
}
Don't laugh, it took me an hour to figure it out.
Isn't there any "unified" syntax on C++? I did not find any usable
documentation on it on the web. Or does each company follows its own
syntax? And what's this "here's a compiler for $399, but you've got to
have Microsoft's one first"-deal about? Honestly, I did not expect to
start having all this trouble right at the "Hello World" step. With
Python, I just downloaded the thing and it worked right away (at least
at the hello world step).