1

I am trying to use the cmph library for the perfect hash function in my code and I am trying to run the simple example http://cmph.sourceforge.net/examples/file_adapter_ex2.c

I installed the library by downloading the cmph package from website and did

  1. ./configure
  2. make
  3. make install

But when I try to run the aforementioned program, I get the following error.

fatal error: 'cmph.h' file not found

then I solved that problem by specifying the '/usr/local/include' path through -I flag but I get another issue as follows :

Undefined symbols for architecture x86_64:
  "_cmph_config_destroy", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_config_new", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_config_set_algo", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_destroy", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_io_nlfile_adapter", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_io_nlfile_adapter_destroy", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_new", referenced from:
      _main in cmph_try1-b75410.o
  "_cmph_search", referenced from:
      _main in cmph_try1-b75410.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help would be appreciated.

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
bhushan
  • 470
  • 3
  • 14

0 Answers0