🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9171

problemas con pow

#9171
From: Antonio
Date: Sat, 31 Aug 2002 10:03
28 lines
2038 bytes
Estoy intentando compilar un programa que me convierte de numeros decimale a 
binarios o a octales o a hexadecimales y cualquier combinacion de ellas.
El problema es que cuando intento compilar me da el siguiente error:
/tmp/cc9dRwKU.o: In function `ConvertirBinDec':
/tmp/cc9dRwKU.o(.text+0x14d): undefined reference to `pow'
/tmp/cc9dRwKU.o: In function `ConvertirOctDec':
/tmp/cc9dRwKU.o(.text+0x257): undefined reference to `pow'
/tmp/cc9dRwKU.o: In function `ConvertirHexDec':
/tmp/cc9dRwKU.o(.text+0x367): undefined reference to `pow'
collect2: ld returned 1 exit status
Os a�ado el fuento de la funcion ConveertirBinDec:
/* FUNCION DE CONVERSION BINARIO-DECIMAL*/

int ConvertirBinDec( char Binario[17])
{
        int dec=0;
        char i=0,j,tam;
        tam=strlen(Binario)-1;

        for (j=tam;Binario[j];j--){
                dec=dec+(Binario[j]-48) * pow(2,i);
                i++;}
        return(dec);}


y en la cabecera esta incluida la libreria math.h, por lo tanto no tengo ni 
idea de que es lo que esta mal.
Un saludo y muchas gracias por vuestra ayuda.
Technical Details
Message-ID: <akq50f$7gq$1@reader2.wnet>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.stealth.net!news.stealth.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,5a7cc67741562d66,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-08-31 03:22:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.stealth.net!news.stealth.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail
From: Antonio <aperlu@obelix.umh.es>
Newsgroups: es.comp.os.linux.programacion
Subject: problemas con pow
Date: Sat, 31 Aug 2002 12:03:27 +0200
Organization: Wanadoo
Lines: 28
Message-ID: <akq50f$7gq$1@reader2.wnet>
NNTP-Posting-Host: 62-37-138-95.dialup.uni2.es
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: reader2.wnet 1030788944 7706 62.37.138.95 (31 Aug 2002 10:15:44 GMT)
X-Complaints-To: usenet@wanadoo.es
NNTP-Posting-Date: Sat, 31 Aug 2002 10:15:44 +0000 (UTC)
User-Agent: KNode/0.7.1