On 12/26/18 4:31 PM, Peng Yu wrote:
> Hi,
> 
> I'd like to compile hashlib.c to try its main(). But I got the
> following error. What is the correct commands to compile it? Thanks.

Think about the error message:

>   "_xmalloc", referenced from:
>       _hash_create in hashlib.o
>       _hash_copy in hashlib.o
>       _hash_search in hashlib.o
>       _hash_insert in hashlib.o
>       _main in hashlib.o
> ld: symbol(s) not found for architecture x86_64

So you need a definition for xmalloc. The easiest thing to do is to add
an xmalloc function in the TEST_HASHING block, or you could follow the
directions in the comment there.

Sooner or later, you're going to have to pick this stuff up on your own.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to