OS X contains heapsort in stdlib.h which conflicts with heapsort in sort library
Posted
by
CryptoQuick
on Stack Overflow
See other posts from Stack Overflow
or by CryptoQuick
Published on 2011-02-12T07:22:50Z
Indexed on
2011/02/12
7:25 UTC
Read the original article
Hit count: 371
I'm using Ariel Faigon's sort library, found here: http://www.yendor.com/programming/sort/
I was able to get all my code working on Linux, but unfortunately, when trying to compile with GCC on Mac, its default stdlib.h contains another heapsort, which unfortunately results in a conflicting types error.
Here's the man page for Apple heapsort: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/heapsort.3.html
Commenting out the heapsort in the sort library header causes a whole heap of problems. (pardon the pun)
I also briefly thought of commenting out my use of stdlib.h, but I use malloc and realloc, so that won't work at all.
Any ideas?
© Stack Overflow or respective owner