Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

First time compile problems

Eoin
Beginner
884 Views
Hello all, I'm new here. I'm pretty much new to Linux in general as well, but I've done alot of programming in my time.

I've installed the Linux Compiler onto a Slackware 8.0 distro, but when I try and compile the simple Hello World as suggested I get a load of errors relating various files.

The first error is in reference to line 9 of include/exception: error: identifer "class" is undefined.

There are various other erros refering to expected ")" and ";".

I'm at a complete loss, does anyone have any ideas?

Thanks in advance.
0 Kudos
5 Replies
cp_jain
Beginner
884 Views
Hello eoinoc,
Please give more info, at least the command you have used
to compile this test.

Here are my comments -
I think the file extension is ".c" or you are
using a C compiler (for eg. icc/gcc). Try using a C++
compiler (icpc/g++) or change the file extension to
".cpp".

I hope this will help.

Regards,
CP
0 Kudos
Eoin
Beginner
884 Views
I just followed the Getting started guide.

#include
int main() {
std::cout << ?Hello World !? << std::endl;
return 0; }

Compile hello.C :
icc hello.C ?o hello

Could the problem lie somewhere in my setup. To install the rpm I used slackware rpm2tgz and installed it that way. The rpm failed due to missing dependences.

Most likely the problem lies there somewhere, but since slackware isn't an rpm based distro I imagine it actually has alot of the dependences just that the installer can't tell.

Is there anyway to find what I may actually be missing. Or has anyone else here installed it on slackware before who did things differently.
0 Kudos
cp_jain
Beginner
884 Views
Please try this - rename hello.C to hello.cpp and compile
it again.

Sorry to say, But I have no idea about installation of
Intel compiler on slackware.

CP
0 Kudos
sunanda-unni7
Beginner
884 Views

The problem lies in the quotes being used in this code for "Hello World !" string. If we copy it straight away from the Getting Started guide to the vi/emacs editor we see different quotes from the one used in a C/C++ program.

Just rewrite the quotes in vi/emacs editor after copying the program.
0 Kudos
Eoin
Beginner
884 Views
Hello again, sorry it took a while to get back to ye. Thanks to everyone who helped solve the problem.

Ultimatly renameing the file to hello.cpp worked.

Thanks again.
0 Kudos
Reply