# /usr/bin/ld:undefined symbol problem



## owning (Mar 28, 2007)

Hello all,
Am relatively new to this world of Mac. Its just that the thing which i am trying works fine on my unix machine but somehow it doesnt get install on my Mac OSX. 
I am trying to install a package for networking libraries
and when i do 
./configure 

configure: creating ./config.status
config.status: creating Makefile.coralvars
config.status: creating Makefile.vars.priv
config.status: creating coraldefs.h
config.status: creating Makefile.vars
config.status: creating apps/example/Makefile.user
config.status: creating apps/example/Makefile
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating etc/Makefile
config.status: creating libsrc/Traffic2/doc/Makefile
config.status: creating libsrc/CAIDA/AppPorts/Makefile
config.status: creating libsrc/CAIDA/doc/Makefile
config.status: creating libsrc/Tables/doc/Makefile
config.status: creating libsrc/hashtab/Makefile
config.status: creating libsrc/libcoral/Makefile
config.status: creating libsrc/misc-perl/Makefile
config.status: creating libsrc/IpPrefixPatricia/Makefile
config.status: creating apps/converters/Makefile
config.status: creating apps/misc/Makefile
config.status: creating apps/netnet/Makefile
config.status: creating apps/security/Makefile
config.status: creating apps/traffic/Reporting/Makefile
config.status: creating apps/traffic/Makefile
config.status: creating apps/utils/Makefile
config.status: creating apps/guess/Makefile
config.status: creating apps/vpvc/Makefile
config.status: creating apps/dnsstat/Makefile
config.status: creating apps/summaries/Makefile
config.status: creating config.h
config.status: creating caida_t.h
config.status: executing default commands
make: Nothing to be done for `postconfigure'.

Configuration complete.
Now when i do the 

make

it starts giving me errors as:

Making in libsrc/hashtab
gcc -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral   -D__STDC_LIBRARY_SUPPORTED__  hashtab.c
ar -cru libhashtab.a hashtab.o  
ranlib libhashtab.a
rm -f ../../lib/libhashtab.a
ln -s `pwd`/libhashtab.a ../../lib

Making in apps/utils
gcc -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_idle_verify.c
gcc -g -O2 -fPIC  -o crl_idle_verify crl_idle_verify.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap  -lstdc++  
/usr/bin/ld: Undefined symbols:
__Unwind_Resume
collect2: ld returned 1 exit status
make[1]: *** [crl_idle_verify] Error 1
make: *** [apps] Error 1


So i really dont know how to solve this out. Can somebody help me. its just that why does it work on my ubuntu but not on my Mac.?

Thanks a lot !!!


----------



## macbri (Mar 29, 2007)

> gcc -g -O2 -fPIC -o crl_idle_verify crl_idle_verify.o -L../../lib -lcoral -lhashtab -lz -lpcap *-lstdc++*


Looks like you're trying to link C++ code with gcc instead of g++..  Try using g++ for the linking stage instead and see if that helps:


```
gcc -g -O2 -fPIC -o crl_idle_verify \
    crl_idle_verify.o -L../../lib -lcoral \
    -lhashtab -lz -lpcap
```


----------



## owning (Mar 29, 2007)

Nope,
It gives me an error again as :

Making in apps/utils
gcc -g -O2 -fPIC  -o crl_idle_verify crl_idle_verify.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
/usr/bin/ld: Undefined symbols:
__Unwind_Resume
operator delete(void*)
operator new(unsigned long)
___gxx_personality_v0
collect2: ld returned 1 exit status
make[1]: *** [crl_idle_verify] Error 1
make: *** [apps] Error 1


I really dont know how to get this working


----------



## macbri (Mar 29, 2007)

I'm very sorry, I'm afraid that I mis-typed!    It *should* read:

```
g++ -g -O2 -fPIC -o crl_idle_verify \
    crl_idle_verify.o -L../../lib -lcoral \
    -lhashtab -lz -lpcap
```
Try that and see what you get.  And don't worry, we'll figure this out


----------



## owning (Mar 29, 2007)

ok Now this is what i get 


Making in apps/utils
g++ -g -O2 -fPIC  -o crl_idle_verify crl_idle_verify.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_cut.c
g++ -g -O2 -fPIC  -o crl_cut crl_cut.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_time.c
g++ -g -O2 -fPIC  -o crl_time crl_time.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_trace.c
g++ -g -O2 -fPIC  -o crl_trace crl_trace.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_fail.c
g++ -g -O2 -fPIC  -o crl_fail crl_fail.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_info.c
g++ -g -O2 -fPIC  -o crl_info crl_info.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_print.c
g++ -g -O2 -fPIC  -o crl_print crl_print.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_print_pkt.c
g++ -g -O2 -fPIC  -o crl_print_pkt crl_print_pkt.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_ips.c
g++ -g -O2 -fPIC  -o crl_ips crl_ips.o  -L../../lib    -lcoral -lhashtab  -lz -lpcap   
g++ -c -g -O2 -fPIC  -I../.. -I../../libsrc/libcoral -I../../libsrc/hashtab  -D__STDC_LIBRARY_SUPPORTED__  crl_stats.c
crl_stats.c: In function 'int compare_flow(const void*, const void*)':
crl_stats.c:130: error: invalid conversion from 'const void*' to 'const flow*'
crl_stats.c:131: error: invalid conversion from 'const void*' to 'const flow*'
crl_stats.c: In function 'long unsigned int make_key_flow(const void*)':
crl_stats.c:144: error: invalid conversion from 'const void*' to 'const flow*'
crl_stats.c: In function 'void delete_flow(void*)':
crl_stats.c:153: error: invalid conversion from 'void*' to 'flow*'
crl_stats.c: In function 'int compare_ip(const void*, const void*)':
crl_stats.c:162: error: invalid conversion from 'const void*' to 'const in_addr*'
crl_stats.c:163: error: invalid conversion from 'const void*' to 'const in_addr*'
crl_stats.c: In function 'void delete_ip(void*)':
crl_stats.c:174: error: invalid conversion from 'void*' to 'in_addr*'
crl_stats.c: In function 'void delete_num(void*)':
crl_stats.c:193: error: invalid conversion from 'void*' to 'int*'
make[1]: *** [crl_stats.o] Error 1
make: *** [apps] Error 1

Now what to do


----------



## owning (Mar 29, 2007)

hey, I got it working with all the permutations of gcc and g++

Thanks for your help


----------

