Search code examples
c++nginxmakefilewurfl

wurfl nginx build errors


I am getting build errors when trying to build Nginx with Wurfl. I am running in a Centos7 VM, combining nginx with other modules and specifying other flags doesn't seem to be causing any problems for me. However when I try to bundle with the wurfl module it fails. It gives errors such as:

            -o objs/addon/src/ngx_http_wurfl_module.o \
        ../src/ngx_http_wurfl_module.c
../src/ngx_http_wurfl_module.c:63:5: error: unknown type name ‘wurfl_useragent_priority’
     wurfl_useragent_priority useragent_priority;
     ^
../src/ngx_http_wurfl_module.c:86:15: error: ‘WURFL_UPDATER_FREQ_DAILY’ undeclared here (not in a function)
     {"DAILY", WURFL_UPDATER_FREQ_DAILY},
               ^
../src/ngx_http_wurfl_module.c:86:5: error: missing initializer for field ‘value’ of ‘nginx_wurfl_updater_frequency_t {aka const struct <anonymous>}’ [-Werror=missing-field-initializers]
     {"DAILY", WURFL_UPDATER_FREQ_DAILY},
     ^
../src/ngx_http_wurfl_module.c:82:15: note: ‘value’ declared here
     const int value;
               ^
../src/ngx_http_wurfl_module.c:87:16: error: ‘WURFL_UPDATER_FREQ_WEEKLY’ undeclared here (not in a function)
     {"WEEKLY", WURFL_UPDATER_FREQ_WEEKLY},
                ^
../src/ngx_http_wurfl_module.c:87:5: error: missing initializer for field ‘value’ of ‘nginx_wurfl_updater_frequency_t {aka const struct <anonymous>}’ [-Werror=missing-field-initializers]
     {"WEEKLY", WURFL_UPDATER_FREQ_WEEKLY},
     ^
../src/ngx_http_wurfl_module.c:82:15: note: ‘value’ declared here
     const int value;
               ^
In file included from src/core/ngx_core.h:58:0,
                 from ../src/ngx_http_wurfl_module.c:22:
../src/ngx_http_wurfl_module.c: In function ‘ngx_http_wurfl_init_main_conf’:
../src/ngx_http_wurfl_module.c:694:93: error: implicit declaration of function ‘wurfl_get_api_version’ [-Werror=implicit-function-declaration]
         ngx_log_error(NGX_LOG_NOTICE, cf->log, 0, "WURFL: Engine created - API version %s", wurfl_get_api_version()

I am trying to build with the latest stable nginx, and a pulled wurfl from yesterday, and gcc 5.3.1. I am more or less using the generic build script provided by WURFL.

Anyone have any thoughts?


Solution

  • So there are a couple of components to the WURFL module and it looks like the issue could be a mismatch on the different components. I would make sure that your libwurfl and wurfl infuze version numbers are the same (the latest version is 1.8.4). Check out the first section of the documentation for more information on how to install libwurfl.

    Next I would make sure that your nginx.conf file is appropriate for the version of wurfl you are using. There have been some big changes in the last few versionsof wurfl that may affect how it performs. You can check the documentation for an example configuration file for the latest version of wurfl. If you are using an older version, you can check the readme provided with the release.

    If fixing these doesn't help, let me know what infuze version number you are working with so I can try to replicate your issue.