2

I'm trying to compile the sorting library from http://www.yendor.com/programming/sort/

Direct Link to library: http://www.yendor.com/programming/sort/sort-all.tgz

When I run make the compiler says:

gcc -g -O -DCUTOFF=15 -c sorttest.c In file included from sorttest.c:15: sort.h:66: error: conflicting types for ‘heapsort’ /usr/include/stdlib.h:301: error: previous declaration of ‘heapsort’ was here make: *** [sorttest.o] Error 1 

Can someone help with this issue?

1
  • looks like two files try to define heapsort Commented Nov 26, 2011 at 4:24

1 Answer 1

2

Frosty,

Well, the compiler is complaining that the type heapsort is already defined at line 301 in /usr/include/stdlib.h ... the traditional methods for dealing with these issues are :

  • Use another name for the offending article in your code. One supposes that myheapsort should do nicely. (and yes you can modify sort-all.tgz, coz it's published under GNU GPL)
  • supress stdlib's definition of heapsort using #def #ifndef (if you can't change your code).
  • Scream, cry, curse, and wish that all stdlibs (at least) where created equal. Sigh.

Hope that helps.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks!, I used your advice and just changed the code to myheapsort.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.