Skip to content

Fix missing nzbget.h includes causing compilation errors#736

Merged
dnzbk merged 1 commit intonzbgetcom:developfrom
sbraz:nzbget_h
Feb 15, 2026
Merged

Fix missing nzbget.h includes causing compilation errors#736
dnzbk merged 1 commit intonzbgetcom:developfrom
sbraz:nzbget_h

Conversation

@sbraz
Copy link
Copy Markdown
Contributor

@sbraz sbraz commented Feb 15, 2026

Description

Hi,
While building nzbget 26.0 for Gentoo, I ran into build problems that I couldn't reproduce when building nzbget manually from the git repo. If you know why, please let me know, I'm curious as to how this slipped past the CI.

Include nzbget.h before other headers in UrlCoordinator.cpp (broken since 0fbd1b5, I assume) and PathsValidator.cpp to ensure functions and types are properly declared before use.

Without this fix, compilation fails with errors like:

/var/tmp/portage/net-nntp/nzbget-26.0/work/nzbget-26.0/daemon/queue/UrlCoordinator.cpp:208:25: error: ‘error’ was not declared in this scope
  208 |                         error("Cancelling hanging url download %s", urlDownloader->GetInfoName());
      |                         ^~~~~
/var/tmp/portage/net-nntp/nzbget-26.0/work/nzbget-26.0/daemon/util/NString.h:67:17: error: ‘free’ was not declared in this scope
   67 |                 free(m_data);
      |                 ^~~~

Lib changes

None

Testing

Build nzbget.

Include nzbget.h before other headers in UrlCoordinator.cpp and
PathsValidator.cpp to ensure functions and types are properly declared
before use.

Without this fix, compilation fails with errors like:
```
/var/tmp/portage/net-nntp/nzbget-26.0/work/nzbget-26.0/daemon/queue/UrlCoordinator.cpp:208:25: error: ‘error’ was not declared in this scope
  208 |                         error("Cancelling hanging url download %s", urlDownloader->GetInfoName());
      |                         ^~~~~
```
```
/var/tmp/portage/net-nntp/nzbget-26.0/work/nzbget-26.0/daemon/util/NString.h:67:17: error: ‘free’ was not declared in this scope
   67 |                 free(m_data);
      |                 ^~~~
```
@dnzbk dnzbk self-requested a review February 15, 2026 18:13
@dnzbk
Copy link
Copy Markdown
Collaborator

dnzbk commented Feb 15, 2026

Thanks, merging this now.

I'm not sure about the CI, as it worked fine when I manually built the app on macOS, Debian and Windows.
It might be a side effect of PCH (Precompiled Headers), but that's just a guess.

@dnzbk dnzbk merged commit 063e1cd into nzbgetcom:develop Feb 15, 2026
9 checks passed
@sbraz
Copy link
Copy Markdown
Contributor Author

sbraz commented Feb 15, 2026

It might be a side effect of PCH (Precompiled Headers), but that's just a guess.

Thanks, it was indeed. I reproduced by checking out the repo before my patch and rebuilding with cmake -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON. Gentoo does that here: https://github.com/gentoo/gentoo/blob/551f40ce2094e810bf60e8c1b817d30a9f66d8bb/eclass/cmake.eclass#L661

Maybe the CI should run with this option too?

@dnzbk
Copy link
Copy Markdown
Collaborator

dnzbk commented Feb 16, 2026

Maybe the CI should run with this option too?

I'll definitely think about that, thanks for the suggestion.

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

Successfully merging this pull request may close these issues.

2 participants