[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pbme avec gcc



nicolas.pignier wrote:

> je compile un petit prog c tout con où j'utilise la fonction sqrt()
> que le compilateur n'arrive pas à lier.
> "gcc -c toto.c" => ca marche
> "ld toto.o" => erreurs normales : unable to link printf(), scanf(), sqrt(),
> ...
> "ld toto.o /lib/libc.so.6" => unable to link sqrt()

Utilise de préférence cc (ou gcc) pour la phase de link, il t'ajouteras
SES libraries (je pense notament à libgcc.a de GCC ou à libmw.a sur NCR
MP-RAS).

> j'ai bien installé gcc et la glibc, donc ma question est la suivante :  où
> est la librairie qui contient les fonctions correspondant à math.h ?

Dans la biliothèque mathématique, ajoute -lm

$ gcc -o toto toto.o -lm
-- 
Edouard G. Parmelan
http://egp.free.fr


Reply to: