still struggling with undefined symbols

owning

Registered
Hello All,
Now i have a new problem and am really frustrated so as to not knowing how to get this working.

Trinity:~ hetawal$ gcc unique.c
unique.c: In function 'main':
unique.c:34: warning: incompatible implicit declaration of built-in function 'malloc'
/usr/bin/ld: Undefined symbols:
_hadd
_hdel
_hfirst
_hnbucket
collect2: ld returned 1 exit status

Trinity:~ hetawal$ g++ unique.c
unique.c: In function 'int main()':
unique.c:34: error: 'malloc' was not declared in this scope
unique.c:48: error: 'free' was not declared in this scope


Can somebody please tell me how to compile a simple .c file wihtout these undefined symbol errors..

That would be of reallly great help!!!!
 
It depends of course on what that simple .c file depends on. For example, hnbucket appears to be part of a hash table algorithm. Do you have a separate file which contains that function?

Looks like this is SDS, in which case you'd find hnbucket code in hashtab.c, and other required functions in other source codes in the same directory. I compiled it as follows:

Code:
gcc -o unique unique.c hashtab.c recycle.c lookupa.c
 
Back
Top