[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: icc C++ problems on Debian 2.4.27-1-686-smp



Jan-Benedict Glaw wrote:

On Tue, 2004-11-23 21:40:52 +0000, michael <linux@networkingnewsletter.org.uk>
wrote in message <41A3AE64.9040603@networkingnewsletter.org.uk>:
michael@ratty:/tmp$ cat sizes.cpp
#include <iostream>

using namespace std;

int main() {
cout << sizeof(char) << "\n";
cout << sizeof(int) << "\n";
cout << sizeof(float) << "\n";
cout << sizeof(double) << "\n";
}
michael@ratty:/tmp$ g++ sizes.cpp
michael@ratty:/tmp$ gcc sizes.cpp
/tmp/ccmtmIBv.o(.text+0x1b): In function `main':
: undefined reference to `std::cout'
[...]

You shouldn't expect a C++ program to link without the stdc++ library.
I just need this compiler up and working for a package I need to evaluate so any help would be most welcome. Thanks, Michael

Your program is written in C++. So why do you expect gcc (which is a C
compiler) to compile it? Would you expect a Pascal compiler to build a
Fortran program? So if you need to build C++ code, use a C++ compiler,
like g++.

MfG, JBG

d'oh - i must be asleep today since I
a) assumed gcc was like icc and was both C & C++
b) thus misread the combined gcc/g++ man page's first line
c) should have known the difference!

Anyway, it's obviously a dead end in trying to solve the actual problem... (getting a working installation of Intel icc (for C++) on Debian)

cheers, michael




Reply to: