0

How to link .exp file in C?

I can link .so, .o, .a, .la, lo and .slo files.
But there is file httpd.h with .exp file only(No .so, .o, .a, .la, lo and .slo files) and I need to use a function from it.
And, I am getting undefined symbol error.

undefined symbol: ap_cstr_casecmp

Tahir Ramzan
  • 43
  • 1
  • 10

2 Answers2

2

.exp file contains the list of exported symbols only. There is no point to link with it, you need the library to link with.

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45
  • This `ap_cstr_casecmp` function is in httpd.h but I am getting 'undefined symbol: ap_cstr_casecmp'. How link it properly to get rid from this error? – Tahir Ramzan Aug 12 '16 at 20:59
2

.exp is used on Windows only and is of no use on Ubuntu. You need a .so or .a file to link to on Ubuntu.

You need to find the library file (lib<name>.so or lib<name>.a or similar, where <name> is the name of the library) and then link with -L<path> -l<name> where <path> should be replaced by the path to the directory that contains the library file. If <path> is /usr/lib then -L<path> can be omitted.

Rufflewind
  • 8,545
  • 2
  • 35
  • 55
  • This `ap_cstr_casecmp` function is in httpd.h but I am getting `undefined symbol: ap_cstr_casecmp`. How link it properly to get rid from this error? There is a file in lib directory httpd.exp in Ubuntu so what is their use then? – Tahir Ramzan Aug 12 '16 at 21:01
  • No such a file, other functions from same header file are working fine but this is not. – Tahir Ramzan Aug 13 '16 at 18:35