ModSecurity icon indicating copy to clipboard operation
ModSecurity copied to clipboard

Compile failure: Not declared in this scope error when attempting to compile on windows using msys2/mingw 64-bit

Open RSDNTWK opened this issue 3 years ago • 3 comments

seclang-scanner.ll: In function ‘yy::seclang_parser::symbol_type yylex(modsecurity::Parser::Driver&)’: seclang-scanner.ll:1272:15: error: ‘strdup’ was not declared in this scope; did you mean ‘strcmp’? seclang-scanner.cc: In function ‘void yy_init_buffer(YY_BUFFER_STATE, FILE*)’: seclang-scanner.cc:9240:48: error: ‘fileno’ was not declared in this scope; did you mean ‘file’? make[3]: *** [Makefile:2097: parser/libmodsecurity_la-seclang-scanner.lo] Error 1

We have no idea what is causing this or how to resolve it.

RSDNTWK avatar Jul 16 '22 23:07 RSDNTWK

Hello @RSDNTWK ,

First note that ModSecurity v3 (aka libModSecurity) running on Windows is not currently supported. ModSecurity v2 can be run on Windows; there is a supported build to run with IIS on Windows, for example.

If you resolve your current build failure, I expect you'll probably encounter additional problem trying to build ModSecurity v3 in mingw on Windows.

What you are currently seeing w.r.t. strdup sounds like a somewhat widely encountered effect with possible resolutions that can be found via an internet search.

martinhsv avatar Jul 22 '22 13:07 martinhsv

@martinhsv We're trying to compile this for nginx for windows using msys2. This is due to recent PCI 6.5 compliancy standards requiring a WAF on all web servers.

RSDNTWK avatar Jul 27 '22 13:07 RSDNTWK

You can pursue that if you like. Given that that is not a standard build environment, I only wanted to caution you that you will likely experience issues. There is another open issue with some discussion that at least somewhat overlaps what you are trying to do ( https://github.com/SpiderLabs/ModSecurity/issues/2480 )

As to the specific issue you raised here (strdup on mingw), that's not really a ModSecurity question; it's mingw/strdup question. As I suggested there do seem to resources on the internet about that issue (I haven't personally tried them, however.)

(I'll leave this open temporarily in case someone else in the community wants to engage/help with that.)

martinhsv avatar Aug 02 '22 19:08 martinhsv