#include <iostream.h>
int main()
{$
int ab=455;
cout << ab << endl;
return 1;
}
I am getting error like
$ gcc u1.cpp
Undefined first referenced
symbol in file
cout /var/tmp/ccK1IfM6.o
ostream::operator<<(ostream &(*)(ostream &))/var/tmp/ccK1IfM6.o
endl(ostream &) /var/tmp/ccK1IfM6.o
ostream::operator<<(int) /var/tmp/ccK1IfM6.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
Heh, I missed that completely, but yes, that may very well be the problem, as even the gcc man page say gcc assumes files are C code, and g++ assumes files are C++ code.
It should be in the same place as gcc... if not, try whereis g++, and if all else fails, try find / -type f -name g++ -print 2>/dev/null... It'll be slow, but hopefully it's installed.
What I intended to ask is ...
I just want to know where the compiler will be available generally & is there any place to search in specific, across machines for any compilers
Well, to the best of my knowledge, there is no real standard in placing programs. For example, I have seen gcc in /usr/bin, /opt/gcc/bin, /usr/contrib/bin, /usr/gnu/bin...
It's just where the admin / distributers want it...