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