The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pro*c compilation error satvd High Level Programming 0 05-21-2008 02:04 AM
Compilation error : Please help jagan_kalluri High Level Programming 1 05-20-2008 01:48 PM
compilation error mannam srinivas HP-UX 2 04-18-2008 10:52 AM
compilation error smanu High Level Programming 2 12-29-2006 06:11 AM
Regarding compilation error. sweta High Level Programming 1 12-10-2006 07:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-18-2002
Registered User
 

Join Date: Nov 2001
Posts: 20
Question compilation error in gcc

Hi,

Should be too simple...

I wrote a sample c++ program like


#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:perator<<(ostream &(*)(ostream &))/var/tmp/ccK1IfM6.o
endl(ostream &) /var/tmp/ccK1IfM6.o
ostream:perator<<(int) /var/tmp/ccK1IfM6.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

Not able to figure out what the problem is.

THanks
ls1429
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-18-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,453
I don't use gcc, but I thought gcc was a c compiler. Your program is in c++.
Reply With Quote
  #3 (permalink)  
Old 01-18-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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.

g++ is what you would need for this.
Reply With Quote
  #4 (permalink)  
Old 01-21-2002
Registered User
 

Join Date: Nov 2001
Posts: 20
Thanks

Is there any idea how to identify where the compiler is ?
I mean the compiler's path

ls1429
Reply With Quote
  #5 (permalink)  
Old 01-21-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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.
Reply With Quote
  #6 (permalink)  
Old 01-21-2002
Registered User
 

Join Date: Nov 2001
Posts: 33
You have to have download it from gcc.gnu.org. But if you have download the full version g++ is included.
Reply With Quote
  #7 (permalink)  
Old 01-21-2002
Registered User
 

Join Date: Nov 2001
Posts: 20
Sorry if I have misled the question.

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


Thanks
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0