BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
678 stars 268 forks source link

Cannot compile c example (basex/basex-api/src/main/c) in ubuntu 22.04 #2131

Closed LIJUCHACKO closed 2 years ago

LIJUCHACKO commented 2 years ago

I am getting following error while make

  $ make example
  cc -L. -lbasexdbc example.c -o example
  /usr/bin/ld: /tmp/ccyvSAeg.o: in function `main':
  example.c:(.text+0x30): undefined reference to `basex_connect'
  /usr/bin/ld: example.c:(.text+0x72): undefined reference to `basex_authenticate'
  /usr/bin/ld: example.c:(.text+0xb5): undefined reference to `basex_execute'
  /usr/bin/ld: example.c:(.text+0x188): undefined reference to `basex_close'
  collect2: error: ld returned 1 exit status
  make: *** [GNUmakefile:33: example] Error 1

Solution Change 33nd line in GNUmakefile to $(CC) -L. example.c -o $@ -l$(LIBNAME) -lcrypto -lssl

ChristianGruen commented 2 years ago

Thanks ෴ 838b6f18d9cab2cc6a73b52a93920eca28b26295