Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RSDNTWK opened this issue Jul 16, 2022 · 3 comments

Comments

@RSDNTWK
Copy link

RSDNTWK commented Jul 16, 2022

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 RSDNTWK changed the title Compile failure: Undefined Reference when attempting to compile on windows using msys2/mingw 64-bit Compile failure: Not declared in this scope error when attempting to compile on windows using msys2/mingw 64-bit Jul 16, 2022
@martinhsv
Copy link
Contributor

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.

@RSDNTWK
Copy link
Author

RSDNTWK commented Jul 27, 2022

@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.

@martinhsv
Copy link
Contributor

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 ( #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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants