_DATADIR_ was not declared in this scope #927

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

I'm trying to build from source on a Debian stretch system.
I checked out the znc-1.7.5 git tag and run:

cd build
cmake ..
make
make install

But it very quickly fails with:

[  4%] Building CXX object src/CMakeFiles/znclib.dir/Translation.cpp.o
/root/repos/znc/src/Translation.cpp: In function ‘std::map<CString, CTranslationInfo> {anonymous}::FillTranslations()’:
/root/repos/znc/src/Translation.cpp:28:14: error: ‘_DATADIR_’ was not declared in this scope
     Dir.Fill(_DATADIR_ "/translations");
              ^~~~~~~~~
src/CMakeFiles/znclib.dir/build.make:139: recipe for target 'src/CMakeFiles/znclib.dir/Translation.cpp.o' failed
make[2]: *** [src/CMakeFiles/znclib.dir/Translation.cpp.o] Error 1
CMakeFiles/Makefile2:353: recipe for target 'src/CMakeFiles/znclib.dir/all' failed
make[1]: *** [src/CMakeFiles/znclib.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I'm trying to build from source on a Debian stretch system. I checked out the `znc-1.7.5` git tag and run: ``` cd build cmake .. make make install ``` But it very quickly fails with: ``` [ 4%] Building CXX object src/CMakeFiles/znclib.dir/Translation.cpp.o /root/repos/znc/src/Translation.cpp: In function ‘std::map<CString, CTranslationInfo> {anonymous}::FillTranslations()’: /root/repos/znc/src/Translation.cpp:28:14: error: ‘_DATADIR_’ was not declared in this scope Dir.Fill(_DATADIR_ "/translations"); ^~~~~~~~~ src/CMakeFiles/znclib.dir/build.make:139: recipe for target 'src/CMakeFiles/znclib.dir/Translation.cpp.o' failed make[2]: *** [src/CMakeFiles/znclib.dir/Translation.cpp.o] Error 1 CMakeFiles/Makefile2:353: recipe for target 'src/CMakeFiles/znclib.dir/all' failed make[1]: *** [src/CMakeFiles/znclib.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 ``` <!-- github-sync-id:509321329 -->
adam closed this issue 2026-10-05 04:53:37 +02:00
Author
Owner

Show make VERBOSE=1 and cmake --system-information. Did you have anything in build/ before?

Show `make VERBOSE=1` and `cmake --system-information`. Did you have anything in build/ before? <!-- github-comment-id:543974121 -->
Author
Owner

Somehow I had a messed up folder - git clean -fxd and starting a fresh build fixed it.

Somehow I had a messed up folder - `git clean -fxd` and starting a fresh build fixed it. <!-- github-comment-id:544118549 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#927