FAQ | Points | Add... | Recent posts | Search | Register | Log in


Problem z math.h w WinAVR-20040720


Post new topic  Reply to topic      Main Page -> Forum Index -> Microcontrollers Generally -> Problem z math.h w WinAVR-20040720
Author
Message
na_naii
Poziom 5
Poziom 5


Joined: 21 Sep 2004
Posts: 14

Post#1 Post from the author of the topic 23 Sep 2004 14:28   

Problem z math.h w WinAVR-20040720


Mam problem z wykorzytaniem funkcji zawartych w math.h. Potrzebuje funkcji floor(); i gdy ja używam dostaje taki komunikat:

nasw.o(.text+0xb9e): In function `main':
C:\Projekty\nasw/nasw.c:288: undefined reference to `floor'


Podobnie dzieje się z innymi funkcjami z math.h
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 23 Sep 2004 14:28   





Back to top
   
juntom
Poziom 15
Poziom 15


Joined: 11 Sep 2003
Posts: 202
Location: Gdańsk

Post#2 23 Sep 2004 15:54   

Re: Problem z math.h w WinAVR-20040720


Rozumiem,ze naglowek #include<math.h> masz ? Probowalem math w winavr z 2004.04.04 smiga bez problemow
Back to top
   
Google

Google Adsense


Post# 23 Sep 2004 15:54   





Back to top
   
na_naii
Poziom 5
Poziom 5


Joined: 21 Sep 2004
Posts: 14

Post#3 Post from the author of the topic 23 Sep 2004 22:50   

Re: Problem z math.h w WinAVR-20040720


Program moze wygladac np tak:
#include <io.h>
#include <lcd.h>
#include <math.h>
#include<stdlib.h>
int main(void)
{
double a,b;
unsigned char *str,wsk[4];
str=&wsk[0];
a=3.32;
b=sin(a);
itoa(b,str,10);
pisztekst(str);
while(1);
}

A konczy sie to tak:
avr-gcc -g -Wall -O2 -mmcu=atmega8 -c -o test.o test.c
avr-gcc -g -Wall -O2 -mmcu=atmega8 -Wl,-Map,test.map -o test.elf test.o
test.o(.text+0x442): In function `main':
C:\WinAVR\Projekty\test/test.c:11: undefined reference to `sin'
make: *** [test.elf] Error 1

Pomocy co robic :cry:
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 23 Sep 2004 22:50   





Back to top
   
juntom
Poziom 15
Poziom 15


Joined: 11 Sep 2003
Posts: 202
Location: Gdańsk

Post#4 24 Sep 2004 12:22   

Re: Problem z math.h w WinAVR-20040720


Bledow nie widze. Skompilowalem na probe ten programik w winavr 200.07.20. Poszlo bez problemu. A czy makefile tworzyles sam czy przy pomocy programu mfile ? Wg mnie to moze byc problemem. Moze tam jest blad, np w sciezce dostepu dirlib... Sprobuj utworzyc makefile przy pomocy programiku mfile.
Back to top
   
na_naii
Poziom 5
Poziom 5


Joined: 21 Sep 2004
Posts: 14

Post#5 Post from the author of the topic 24 Sep 2004 21:28   

Re: Problem z math.h w WinAVR-20040720


Juz dziala :)
wystarczlo dodac -lm
Poprostu nie przeczytalem uwaznie FAQ do bibliotek :) ( 2 punkt)
Ehh zdaza sie czasem jak sie cos kce zrobic szybko.
Back to top
   
Post new topic  Reply to topic      Main Page -> Forum Index -> Microcontrollers Generally -> Problem z math.h w WinAVR-20040720
Page 1 of 1
Similar topics
[JAVA] Math.random - wyłączenie liczby z zakresu. (6)
[AT91SAM7X] arc tan ( atanf ) z biblioteki math.h (11)
[AVR][WINAVR] Numerowanie kolejnych kompilacji pod WinAVR (4)
Złe przeliczanie math w Bascom (4)
[C] Opis funkcji biblioteki math.h (2)
avr +math.h +log10 (3)
WinAVR, atmega8 i sqrt. Biblioteka math. Jak to obejść? (3)
[WinAVR] WinAVR nie generuje plików. (7)
[Atmega32][c]Napisy w pamięci flash, math.h i prosty lcd (6)

Page generation time: 3.061 seconds


FAQ || Administrator || Moderators || Widgets and banners || Contact
elektroda.pl topic RSS feed