pmundkur / libcrm114

C library version of CRM114, and a Python binding
http://crm114.sourceforge.net/wiki/doku.php?id=download
14 stars 7 forks source link

Linking fails under Mac OS X 10.7.2 #1

Open mejo opened 12 years ago

mejo commented 12 years ago

Changed Makefile: $(CC) -shared -Wl,-soname,$(LIB_NAME) -o lib/$(LIB_NAME) $(LIBOBJS) to be: $(CC) -shared -Wl,-dylib_install_name,$(LIB_NAME) -o lib/$(LIB_NAME) $(LIBOBJS)

While running 'make' it gives:

cc -c -g -Iinclude -fpic -std=c99 -pedantic -Wall -Wextra -Wpointer-arith -Wstrict-prototypes -Wno-sign-compare -Wno-overlength-strings -o lib/crm114_regex_tre.o lib/crm114_regex_tre.c
lib/crm114_regex_tre.c: In function ‘crm114__regfree’:
lib/crm114_regex_tre.c:61: warning: ISO C forbids conversion of function pointer to object pointer type
cc -shared -Wl,-dylib_install_name,libcrm114.so.1 -o lib/libcrm114.so.1  lib/crm114_base.o  lib/crm114_markov.o  lib/crm114_markov_microgroom.o  lib/crm114_bit_entropy.o  lib/crm114_hyperspace.o  lib/crm114_svm.o  lib/crm114_svm_lib_fncts.o  lib/crm114_svm_quad_prog.o  lib/crm114_fast_substring_compression.o  lib/crm114_pca.o  lib/crm114_pca_lib_fncts.o  lib/crm114_matrix.o  lib/crm114_matrix_util.o  lib/crm114_datalib.o  lib/crm114_vector_tokenize.o  lib/crm114_strnhash.o  lib/crm114_util.o  lib/crm114_regex_tre.o
Undefined symbols for architecture x86_64:
  "_tre_regncomp", referenced from:
      _crm114__regncomp in crm114_regex_tre.o
  "_tre_regnexec", referenced from:
      _crm114__regnexec in crm114_regex_tre.o
  "_tre_regerror", referenced from:
      _crm114__regerror in crm114_regex_tre.o
  "_tre_regfree", referenced from:
      _crm114__regfree in crm114_regex_tre.o
  "_tre_free", referenced from:
      _crm114__regfree in crm114_regex_tre.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [lib/libcrm114.so] Error 1```

I suppose there is something to be added for Makefile to make shared library (tre) to be loaded?
pmundkur commented 12 years ago

Thanks for trying it out! What version of cc does this version of OSX use? (Is this gcc by the way, or the llvm version?)

mejo commented 12 years ago

Thanks for improving libcrm114 :) I found out following: $ cc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)