Teen Programmers Unite  
 

 

Return to forum top

How to programming C++ under Linux

Posted by csspcman [send private reply] at February 16, 2002, 06:31:11 AM

I have recently installed Linux and I wanted to experience programming C++ under it but when I want to compile my simple program with "cc filename.c" command I immidiatly
get an error which says "/usr/bin/ld: cannot find -lgcc"
where was I wrong ?

Posted by Psion [send private reply] at February 16, 2002, 09:30:40 AM

It sure looks like you made some basic mistake installing GCC. You might want to try it again.

Posted by max621 [send private reply] at February 18, 2002, 01:43:53 PM

try
gcc filename.c
g++ filename.c
lgcc filename.c
i also think u gotta put something else in there to link ur compiled stuff...

Posted by unknown_lamer [send private reply] at February 19, 2002, 03:02:36 PM

For one, for C++ you have to use G++ (or at least rename the file to .C [uppercase C], I forget if GCC can detect what compiler front-end to use based on extension). Two: finish installing the compiler. What distro are you using? If you are using Debian then run 'apt-get install task-c++-dev' for potato, or 'apt-get install c++-dev' in woody.

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.