Re: [LINUX:3150] C++ derleme?

Okan Asik (okana@superonline.com)
Thu, 18 Jun 1998 20:39:15 -0700


Selam,

Sanirim Red Hat tabanli bir sistem kullaniyorsunuz. Ben sizin yerinizde
olsam Slackware kurardim. Fakat illede Red Hat kullanicagim derseniz,
http://www.redhat.com/errata 'dan GlibC ve libc5 dosyalarinin update'lerini
cekmeniz gerekir. Ama unutmamak sunuda gerekir ki, ileride Linux u daha iyi
ogrendiginiz de bunun gibi sorunlar, siz Red Hat`den kurtulana kadar yine
karsiniza cikacaktir.

Saygilarla...

Pc NET
Okan Asik < okana@linux.org.tr >

Osman Demirhan wrote:

> Herkese selam;
>
> C++ ile yazilmis basit bir iki programi derlerken derleme hatalari ile
> karsilastim. Dusunceme gore gcc'ye eksik parametre girdim. Acaba C++ ile
> yazilmis kodu gcc ile derlerken hangi secenekleri kullanmaliyim?
>
> Herkese kolay gelsin.
>
> Saygi, sevgi, LinuX.
>
> ----------------------------------------------------------
> Birinci Dosya: (Klasik baslama programi:)
>
> #include <iostream.h>
> #include <iomanip.h>
> main (){
> cout << "Hello!;
> }
>
> Komut satiri: gcc hello.cc -o hello
>
> HATA MESAJI:
>
> hello.cc:4: unterminated string or character constant
> hello.cc:4: possible real start of unterminated constant
> ---------------------------------------------------------------
>
> Ikinci Dosya:
>
> #include <iostream.h>
> #include <iomanip.h>
> main (){
> float temp;
> cout << "Please type the temprature (deg F): ";
> cin >> temp;
> cout << temp;
> cout << "Deg F is";
> cout << (5.0 * (temp - 32)) / 9.0;
> cout << "deg C";
> }
>
> Komut satiri yine ayni
>
> HATA MESAJI:
>
> /tmp/cca007571.o: In function `main':
> /tmp/cca007571.o(.text+0xc): undefined reference to `cout'
> /tmp/cca007571.o(.text+0x11): undefined reference to
> `ostream::operator<<(char const *)'
> /tmp/cca007571.o(.text+0x1f): undefined reference to `cin'
> /tmp/cca007571.o(.text+0x24): undefined reference to
> `istream::operator>>(float&)'
> /tmp/cca007571.o(.text+0x31): undefined reference to `cout'
> /tmp/cca007571.o(.text+0x36): undefined reference to
> `ostream::operator<<(float)'
> /tmp/cca007571.o(.text+0x45): undefined reference to `cout'
> /tmp/cca007571.o(.text+0x4a): undefined reference to
> `ostream::operator<<(char const *)'
> /tmp/cca007571.o(.text+0x75): undefined reference to `cout'
> /tmp/cca007571.o(.text+0x7a): undefined reference to
> `ostream::operator<<(double)'
> /tmp/cca007571.o(.text+0x89): undefined reference to `cout'
> /tmp/cca007571.o(.text+0x8e): undefined reference to
> `ostream::operator<<(char const *)'
>
>
> --------------------------------------
> | Osman Demirhan |
> | Kocaeli Universitesi |
> | Elektronik ve Haberlesme Muh. Bol. |
> --------------------------------------