tvlooy
tvlooy

Reputation: 1036

Cmocka link apache runtime functions

I am trying to unit test an Apache module with Cmocka.

When I run the simple tests I get an error that it can't find function ap_rprintf. I try to build like this:

gcc -o run_test mod_hello.c run_test.c \
  -lcmocka -lapr-1 \
  -I/usr/include/apache2 -I/usr/include/apr-1.0

I isolated the issue into a very simple case at https://github.com/tvlooy/cmocka_apache_module/

What's missing?

Upvotes: 0

Views: 34

Answers (1)

tvlooy
tvlooy

Reputation: 1036

it compiles by adding the linker flag -Wl,--unresolved-symbols=ignore-in-object-files

Upvotes: 0

Related Questions