Compilation on Debian

I’ve been able to compile Haiku x86_64 iso on Debian but I’ve noticed a compilation error which I have fixed.
Unfortunately I’m unable to setup my gerrit account from my Debian machine to propose the patch :slight_smile:

Below is the fix for this error :

git diff
diff --git a/src/kits/storage/sniffer/RPattern.cpp b/src/kits/storage/sniffer/RPattern.cpp
index 814f369e99..665ca7ece5 100644
--- a/src/kits/storage/sniffer/RPattern.cpp
+++ b/src/kits/storage/sniffer/RPattern.cpp
@@ -15,6 +15,7 @@
 #include "RPattern.h"
 #include "Range.h"
 #include "Data.h"
+#include <cstddef>
 
 using namespace BPrivate::Storage::Sniffer;
1 Like

Which compilation error?

This one :

C++ objects/linux/x86_64/release/build/libbe/storage/RPattern.o 
C++ objects/linux/x86_64/release/build/libbe/storage/Rule.o 
../src/kits/storage/sniffer/RPattern.cpp: In static member function ‘static BPrivate::Storage::Sniffer::RPattern* BPrivate::Storage::Sniffer::RPattern::Create(BPrivate::Storage::Sniffer::Range, bool, const std::string&, std::string)’:
../src/kits/storage/sniffer/RPattern.cpp:27:34: error: expected primary-expression before ‘,’ token
   27 |                 offsetof(RPattern, fPattern), caseInsensitive, string, mask);
      |                                  ^
../src/kits/storage/sniffer/RPattern.cpp:27:36: error: invalid use of member ‘BPrivate::Storage::Sniffer::RPattern::fPattern’ in static member function
   27 |                 offsetof(RPattern, fPattern), caseInsensitive, string, mask);
      |                                    ^~~~~~
In file included from ../src/kits/storage/sniffer/RPattern.cpp:15:
../src/kits/storage/sniffer/RPattern.h:43:17: note: declared here
   43 |         Pattern fPattern;
      |                 ^~~~
../src/kits/storage/sniffer/RPattern.cpp:27:17: error: ‘offsetof’ was not declared in this scope
   27 |                 offsetof(RPattern, fPattern), caseInsensitive, string, mask);
      |                 ^~~~~~
../src/kits/storage/sniffer/RPattern.cpp:18:1: note: ‘offsetof’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
   17 | #include "Data.h"
  +++ |+#include <cstddef>
   18 | 
gcc -c "../src/kits/storage/sniffer/RPattern.cpp" -O2 -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -fPIC -include ../headers/build/BeOSBuildCompatibility.h -DARCH_x86_64 -D_NO_INLINE_ASM -D__NO_INLINE__ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAIKU_HOST_PLATFORM_LINUX -DHAIKU_HOST_PLATFORM_64_BIT -DHAIKU_PACKAGING_ARCH=\"x86_64\" -iquote ../build/user_config_headers -iquote ../build/config_headers -iquote ../src/build/libbe/storage -iquote objects/common/build/libbe/storage -iquote objects/linux/x86_64/common/build/libbe/storage -iquote objects/haiku/x86_64/common/build/libbe/storage -iquote ../src/kits/storage -iquote ../src/kits/storage/mime -iquote ../src/kits/storage/sniffer -I ../headers/build/private/app -I ../headers/build/private/kernel -I ../headers/build/private/shared -I ../headers/build/private/storage -I ../headers/build/host/linux -I ../headers/build -I ../headers/build/os -I ../headers/build/os/add-ons/registrar -I ../headers/build/os/app -I ../headers/build/os/bluetooth -I ../headers/build/os/drivers -I ../headers/build/os/kernel -I ../headers/build/os/interface -I ../headers/build/os/locale -I ../headers/build/os/storage -I ../headers/build/os/support -I ../headers/build/private -o "objects/linux/x86_64/release/build/libbe/storage/RPattern.o"
...failed C++ objects/linux/x86_64/release/build/libbe/storage/RPattern.o ...
BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 8 target(s)...
...updated 1 target(s)...

I have the same issue on Debian 12. Which version of Debian are you building on? I don’t know if it would still be an issue on Debian 13…

I have Debian 12 / GCC 12

No problems for me in debian 13, gcc 14.2.