Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking fails under Mac OS X 10.7.2 #1

Open
mejo opened this issue Jan 31, 2012 · 2 comments
Open

Linking fails under Mac OS X 10.7.2 #1

mejo opened this issue Jan 31, 2012 · 2 comments

Comments

@mejo
Copy link

mejo commented Jan 31, 2012

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
Copy link
Owner

pmundkur commented Feb 1, 2012

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
Copy link
Author

mejo commented Feb 1, 2012

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants