gcc - g++ - Poly periergo
Yiannis Belias
orion at hellug.gr
Mon Jan 15 10:48:11 EET 2001
dimitris kamenopoulos wrote:
>
> ¸öôéáîá Ýíá áñ÷åéÜêé x.c ðïõ ÷ñçóéìïðïéïýóå ôñåéò óõíáñôÞóåéò ôïõ math.h
> (ü÷é ôßðïôá äéáóôçìéêü, ôéò cos, sin êáé fmod).
> Ëïéðüí, üôáí ôï ìåôáãëùôôßæù ìå ôïí gcc, ôï ld ìïõ ðáñáðïíéÝôáé ãéá
> "undefined reference to cos, sin êáé fmod".
> ¼ôáí ÔÏ ÉÄÉÏ áñ÷åßï ôï ìåôïíïìÜæù óå x.cc êáé ôï ìåôáãëùôôßæù ìå ôïí
> g++, äçìéïõñãåßôáé êáíïíéêÜ ôï åêôåëÝóéìï, êáé ôñÝ÷åé ÷ùñßò ðñüâëçìá.
> ¼÷é üôé ìå ðåßñáîå éäéáßôåñá áõôü ôï ðñïâëçìáôÜêé (Þôáí äåêôÞ êáé ç
> C++ óôçí åñãáóßá ðïõ Ýðñåðå íá ðáñáäþóù), áëëÜ ìå ðáñáîÝíåøå
> ðÜñá ðïëý.
> ÊáìéÜ éäÝá ãéáôß ï g++ âëÝðåé ôï math.h, êáé ï gcc äåí ôï âëÝðåé;
> ÓçìåéùôÝïí üôé ôï math.h õðïôßèåôáé üôé ðñÝðåé íá ëåéôïõñãåß óôçí
> ANSI C.
> ÄçìÞôñçò
Hi,
Dokimase ayto:
$ gcc test.c -o test -lm
To math.h to pros8etei o preprosesor, apla o linker den kanei link apo
default me to libm.so... Ayto tou to leei to -lm.
Perissoteres leptomereies gia th diaforetikh symperifora tou g++
den exw yp' opsh mou.
Ayta,
Yiannis
--
Yiannis Belias <orion at hellug.gr> `
Athens University ' .
Physics Department GNU+LINUX: ' '
IN A WORLD WITHOUT FENCES WHO NEEDS GATES? .
*
More information about the Linux-greek-users
mailing list