<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
Compiling nghttp2 is failing for me in Alpine 3.21, which uses gcc 14 (14.2.0). It looks like the issue is that the header file `nghttp2.h` need to be explicitly included in the `nghttp2_mod.c` files. This is the error when running `make` inside of `src/modules/nghttp2` (after compiling kamailio as normal):
```
/home/builder/kamailio_src/src/modules/nghttp2 # make
make: --libs: No such file or directory
make: --libs: No such file or directory
make: --libs: No such file or directory
make: --libs: No such file or directory
CC (gcc) [M nghttp2.so] nghttp2_mod.o
nghttp2_mod.c: In function 'ksr_nghttp2_send_reply':
nghttp2_mod.c:317:22: error: implicit declaration of function 'nghttp2_submit_response'; did you mean 'nghttp2_submit_response2'? [-Wimplicit-function-declaration]
317 | rv = nghttp2_submit_response(_ksr_nghttp2_ctx.session,
| ^~~~~~~~~~~~~~~~~~~~~~~
| nghttp2_submit_response2
make: *** [../../Makefile.rules:100: nghttp2_mod.o] Error 1
```
### Troubleshooting
Compilation works on Debian 12, so checked difference in `make` and `gcc` versions. Note that the `make: --libs: No such file or directory` appear to be from a different issue with `make` 4.4 not recursively expanding variables. From gcc's documentation it looks like implicit function declarations are no longer possible
https://gcc.gnu.org/gcc-14/porting_to.html
#### Reproduction
Compile Kamailio 6.0.0 (with default config), then compile the nghttp2 module
### Possible Solutions
Explicitly import `nghttp2.h` in `nghttp2_mod.c` and `nghttp2_server.c`. This is outside of my normal wheelhouse, but I was able to do this and successfully compile the module:
##### Diff for `nghttp2_mod.c`:
```
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
+#include <nghttp2/nghttp2.h>
#include "../../core/sr_module.h"
#include "../../core/dprint.h"
```
##### Diff for `nghttp2_server.c`:
```
@@ -23,6 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <nghttp2/nghttp2.h>
#include "nghttp2_server.h"
#define OUTPUT_WOULDBLOCK_THRESHOLD (1 << 16)
```
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
Kamailio 6.0.0 with gcc 14.2.0
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
/home/builder/kamailio_src/src/modules/nghttp2 # lsb_release -a
No LSB modules are available.
Distributor ID: Alpine
Description: Alpine Linux v3.21
Release: 3.21.2
Codename: n/a
/home/builder/kamailio_src/src/modules/nghttp2 # uname -a
Linux 89562285153f 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4135
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4135(a)github.com>
- Explicitly include nghttp2.h file GH #4135
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #4135
#### Description
<!-- Describe your changes in detail -->
Explicitly include nghttp2.h file in `src/modules/nghttp2/nghttp2_mod.c` and `src/modules/nghttp2/nghttp2_server.c`
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4136
-- Commit Summary --
* nghttp2: compilation with gcc 14
-- File Changes --
M src/modules/nghttp2/nghttp2_mod.c (1)
M src/modules/nghttp2/nghttp2_server.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4136.patchhttps://github.com/kamailio/kamailio/pull/4136.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4136
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4136(a)github.com>