Why can't gcc find the random() interface when -std=c99 is set?

前端 未结 4 1797
借酒劲吻你
借酒劲吻你 2020-12-15 06:26

I do \"#include \" at the top of the source.

Example compilation:

/usr/bin/colorgcc -std=c99 -fgnu89-inline  -g -Wall -I         


        
4条回答
  •  -上瘾入骨i
    2020-12-15 06:39

    I use rand() and srand(). BTW: Did you forget a header or two? At least the second warning tells me so.

    Try including math.h. (Just remembered we always had issues with math library and had to actually force link it with -lm).

提交回复
热议问题