-6

I included math.h library and used abs function and this error shows:

error: implicit declaration of function ‘abs’ [-Werror=implicit-function-declaration]
razlika=(abs(x3) / ((x1+x2)/2))*100;
^
cc1: some warnings being treated as errors
  • 2
    Please remove c++ tag if you are using c language, and paste the error as text please, so other users can find the error – Roberto Dec 12 '15 at 17:50
  • 1
    Please post relevant warnings and code *as text* in the question. Images are useless for most purposes. – fuz Dec 12 '15 at 17:50
  • 2
    Don't use a screenshot when you can show identical text. Screenshots won't show up in text searches, making this question almost impossible to discover. – IInspectable Dec 12 '15 at 17:50
  • 2
    Please include text, not screenshots of text. This helps us to help you, because we can easily copy the text to do searches, and it helps search engines index the question properly. – Dan Lowe Dec 12 '15 at 17:51
  • 1
    Possible duplicate of [abs 'implicit declaration...' error after including math.h](http://stackoverflow.com/questions/29577833/abs-implicit-declaration-error-after-including-math-h) – Nuetrino Dec 12 '15 at 17:52
  • _"Used abs function"_ Used it how? Where is your code? – Lightness Races in Orbit Dec 12 '15 at 17:52

1 Answers1

3

Include stdlib.h, not math.h.

Implicit declaration errors are generally due to missing/incorrect header files.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
S.I.J
  • 979
  • 1
  • 10
  • 22