Modules using STL fail to start if ZNC is built with --enable-debug #126

Closed
opened 2026-10-05 04:00:18 +02:00 by adam · 2 comments
Owner

Steps to reproduce:

  1. Use ZNC compiled with --enable-debug
  2. Add #include <map> at the top of sample.cpp
  3. znc-buildmod sample.cpp
  4. loadmod sample

Unable to find modinfo [sample] [Unable to open module [sample] [/home/xxx/.znc/modules/sample.so: undefined symbol: _ZN7CModule13OnClientCapLsEP7CClientRSt3setI7CStringSt4lessIS3_ESaIS3_EE]]

#### Steps to reproduce: 1. Use ZNC compiled with --enable-debug 2. Add `#include <map>` at the top of sample.cpp 3. znc-buildmod sample.cpp 4. loadmod sample > Unable to find modinfo [sample] [Unable to open module [sample] [/home/xxx/.znc/modules/sample.so: undefined symbol: _ZN7CModule13OnClientCapLsEP7CClientRSt3setI7CStringSt4lessIS3_ESaIS3_EE]] <!-- github-sync-id:5805222 -->
adam closed this issue 2026-10-05 04:00:18 +02:00
Author
Owner

Fix: Add #include <znc/zncconfig.h> before any STL library.

**Fix:** Add `#include <znc/zncconfig.h>` before any STL library. <!-- github-comment-id:7210390 -->
Author
Owner

Yeh, zncconfig.h or any other ZNC header.
All of them already include zncconfig.h, and you'll need to include at least Modules.h anyway to write a module.

So, this works:

#include <znc/Modules.h>
#include <map>
Yeh, zncconfig.h or any other ZNC header. All of them already include zncconfig.h, and you'll need to include at least Modules.h anyway to write a module. So, this works: ``` #include <znc/Modules.h> #include <map> ``` <!-- github-comment-id:7238920 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#126