Richard Sand
Richard Sand

Reputation: 674

Configure Eclipse C++ to build Apache HTTP module

I'm trying to build an Apache Module in C++ using Eclipse. From the command-line, the Apache utility apxs can be used to build and install a module from source, but I'd like to be able to build from within Eclipse. I've set Eclipse to use the cross-g++ compiler, added /usr/include/http to the includes folder, and added the libraries "apr-1", "aprutil-1", and "pcre" to the linker.

The code compiles, i.e. it sees the Apache headers, but fails to link with errors indicating it cannot find the Apache libraries. But for the life of me I cannot figure out what library includes the module APIs, and all online references I've found simply say "use apxs".

undefined reference to `ap_log_error_'
undefined reference to `ap_hook_handler'

Any insights appreciated!

Upvotes: 0

Views: 241

Answers (1)

E.Lord
E.Lord

Reputation: 26

  1. Click the project and go to properties in order to manage settings.
  2. C/C++ Build > Settings > Tool Settings tab > Cross GCC compiler >Miscellaneous > make sure that -fPIC flag is checked
  3. C/C++ Build > Settings > Tool Settings tab > Build Artifact tab > Choose Shared library
  4. Please add include directories and library paths

Upvotes: 1

Related Questions