need compiler for c++ function like "drand48(), abort() .."

hi,
i am beginner in programming and i have compilation errors when i compile lines that containes fuctions like "drand48(), abort()....etc", the compiler that i use is gcc that come with codeblocks on windows. i think that i must use another compiler?
could any one give me solution.
best regards
closed account (E0p9LyTq)
For abort() just include the <cstdlib> (C++ code) or <stdlib.h> (C) header.
http://www.cplusplus.com/reference/cstdlib/abort/

Change the drand48() call to rand(). drand48() is a Linux compiler function that is non-standard.
http://stackoverflow.com/questions/11065861/drand48-on-windows#11068161
your reply is so helpful i understand now thank you so much
closed account (E0p9LyTq)
If you really want good C++ random number generation then avoid the C library functions. With C++11 use the <random> header and one of the generator engines instead.
http://www.cplusplus.com/reference/random/
thank u again i will see it
Last edited on
Topic archived. No new replies allowed.