First time compile problems

First time compile problems

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.

6 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

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.

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

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.

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.

发表评论

登录添加评论。还不是成员?立即加入