stylus icon indicating copy to clipboard operation
stylus copied to clipboard

Build fails on Fedora Linux 42

Open Ash-Olorenshaw opened this issue 2 months ago • 0 comments

Describe the bug On Fedora Linux 42, using G++ 15.2.1 20250808 (Red Hat 15.2.1-1), when running mvn install, build fails with:

Exception.h:35:38: error: ‘uint16_t’ does not name a type   

To Reproduce Steps to reproduce the behavior:

  1. Clone repo
  2. cd stylus && mvn install
  3. See error:
[ 39%] Building CXX object dependencies/jni-voithos/CMakeFiles/jni-voithos.dir/src/Exception.cpp.o                                                                                                                                                                                                                              
In file included from /mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/src/Exception.cpp:8:                                                                                                                                                                                                      
/mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/include/Exception.h:35:38: error: ‘uint16_t’ does not name a type                                                                                                                                                                               
   35 |                         static const uint16_t MAX_MESSAGE_LEN = 1024;                                                                                                                                                                                                                                                   
      |                                      ^~~~~~~~                                                                                                                                                                                                                                                                           
/mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/include/Exception.h:13:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’                                                                                                            
   12 | #include <string>                                                                                                                                                                                                                                                                                                       
  +++ |+#include <cstdint>                                                                                                                                                                                                                                                                                                      
   13 |                                                                                                                                                                                                                                                                                                                         
/mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/src/Exception.cpp: In constructor ‘jni::Exception::Exception(const char*, ...)’:                                                                                                                                                                
/mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/src/Exception.cpp:18:29: error: ‘MAX_MESSAGE_LEN’ was not declared in this scope                                                                                                                                                                
   18 |                 char buffer[MAX_MESSAGE_LEN];                                                                                                                                                                                                                                                                           
      |                             ^~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                             
/mnt/D-Files/langs/Java/stylus/stylus-jni/src/main/cpp/dependencies/jni-voithos/src/Exception.cpp:22:27: error: ‘buffer’ was not declared in this scope; did you mean ‘setbuffer’?                                                                                                                                              
   22 |                 vsnprintf(buffer, MAX_MESSAGE_LEN, msg, args);                                                                                                                                                                                                                                                          
      |                           ^~~~~~                                                                                                                                                                                                                                                                                        
      |                           setbuffer                                                                                                                                                                                                                                                                                     
gmake[2]: *** [dependencies/jni-voithos/CMakeFiles/jni-voithos.dir/build.make:76: dependencies/jni-voithos/CMakeFiles/jni-voithos.dir/src/Exception.cpp.o] Error 1                                                                                                                                                              
gmake[1]: *** [CMakeFiles/Makefile2:190: dependencies/jni-voithos/CMakeFiles/jni-voithos.dir/all] Error 2                                                                                                                                                                                                                       
gmake: *** [Makefile:136: all] Error 2                                                                          

Expected behavior Expected full clean build

Screenshots

Desktop (please complete the following information):

  • OS: Fedora Linux 42
  • Maven: Apache Maven 3.9.9 (Red Hat 3.9.9-14)
  • G++: 15.2.1 20250808 (Red Hat 15.2.1-1)

Additional context To fix, I just chucked #include <cstdint> into stylus-jni/src/main/cpp/dependencies/jni-voithos/include/Exception.h and then installed libstdc++-static and build ran perfectly. If you like, I can put in a pull request for this.

Ash-Olorenshaw avatar Sep 15 '25 07:09 Ash-Olorenshaw