Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bunch of errors during make phase in Ubuntu 23.10 #162

Open
raphael10-collab opened this issue Apr 18, 2024 · 1 comment
Open

Bunch of errors during make phase in Ubuntu 23.10 #162

raphael10-collab opened this issue Apr 18, 2024 · 1 comment

Comments

@raphael10-collab
Copy link

Following the indications here: https://github.com/open-license-manager/licensecc?tab=readme-ov-file#build-on-linux I tried to compile and build Licensecc in Ubuntu 23.10, but got a bunch of errors during make phase:

raphy@raohy:~$ git clone --recursive https://github.com/open-license-manager/licensecc.git
Cloning into 'licensecc'...
remote: Enumerating objects: 4287, done.
remote: Counting objects: 100% (400/400), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 4287 (delta 354), reused 333 (delta 333), pack-reused 3887
Receiving objects: 100% (4287/4287), 7.09 MiB | 9.39 MiB/s, done.
Resolving deltas: 100% (2694/2694), done.
Submodule 'license-generator' (https://github.com/open-license-manager/lcc-license-generator.git) registered for path 'extern/license-generator'
Cloning into '/home/raphy/licensecc/extern/license-generator'...
remote: Enumerating objects: 473, done.        
remote: Total 473 (delta 0), reused 0 (delta 0), pack-reused 473        
Receiving objects: 100% (473/473), 249.70 KiB | 2.94 MiB/s, done.
Resolving deltas: 100% (320/320), done.
Submodule path 'extern/license-generator': checked out '0227a3ef327a60ef6cca96d554a485711cc82ea5'
raphy@raohy:~$ 
raphy@raohy:~$ cd licensecc/build/
raphy@raohy:~/licensecc/build$ 
raphy@raohy:~/licensecc/build$ cmake .. -DCMAKE_INSTALL_PREFIX=../install
-- You should define a variable LCC_PROJECT_NAME containing the name of the software you want to add a license to.A mock project named DEFAULT has been added for you.
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Could NOT find lccgen (missing: lccgen_DIR)
-- Submodule update
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found openssl version 3.0.10 - generator
-- Found Boost: /lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: date_time filesystem program_options system unit_test_framework
-- CXX compiler              : /usr/bin/c++
-- CXX compiler flags        : 
-- CXX compiler flags debug  : -g
-- CXX compiler flags release: -O3 -DNDEBUG
-- Install prefix            : /home/raphy/licensecc/install
-- External libs             : 
-- Found openssl version 3.0.10 -licensecc
-- openssl 3.0.10 zlib not required - licensecc
-- CXX compiler        : /usr/bin/c++
-- CXX compiler flags  : 
-- CXX compiler flags debug : -g
-- CXX compiler flags release: -O3 -DNDEBUG
-- Install prefix      : /home/raphy/licensecc/install
-- Project name        : DEFAULT
-- Project base dir    : /home/raphy/licensecc/projects/DEFAULT
-- Found Boost: /lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: unit_test_framework system filesystem
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.4") found components: doxygen dot
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
-- Doxygen or Sphynx not found, not generating docs.
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/licensecc/build
raphy@raohy:~/licensecc/build$ 

raphy@raohy:~/licensecc/build$ make
[  1%] Building CXX object extern/license-generator/src/base_lib/CMakeFiles/lcc_base.dir/base64.cpp.o
In file included from /home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:6:
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.h:14:13: error: ‘uint8_t’ was not declared in this scope
   14 | std::vector<uint8_t> unbase64(const std::string& base64_data);
      |             ^~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.h:6:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    5 | #include <vector>
  +++ |+#include <cstdint>
    6 | #ifdef __linux__
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.h:14:20: error: template argument 1 is invalid
   14 | std::vector<uint8_t> unbase64(const std::string& base64_data);
      |                    ^
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.h:14:20: error: template argument 2 is invalid
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:107:13: error: ‘uint8_t’ was not declared in this scope
  107 | std::vector<uint8_t> unbase64(const std::string& base64_data) {
      |             ^~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include "base64.h"
  +++ |+#include <cstdint>
    7 | namespace license {
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:107:20: error: template argument 1 is invalid
  107 | std::vector<uint8_t> unbase64(const std::string& base64_data) {
      |                    ^
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:107:20: error: template argument 2 is invalid
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp: In function ‘int license::unbase64(const std::string&)’:
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:111:21: error: ‘uint8_t’ was not declared in this scope
  111 |         std::vector<uint8_t> bin;
      |                     ^~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:111:21: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:111:28: error: template argument 1 is invalid
  111 |         std::vector<uint8_t> bin;
      |                            ^
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:111:28: error: template argument 2 is invalid
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:126:13: error: request for member ‘reserve’ in ‘bin’, which is of non-class type ‘int’
  126 |         bin.reserve(flen);
      |             ^~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:134:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  134 |                 bin.push_back((A << 2) | (B >> 4));
      |                     ^~~~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:135:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  135 |                 bin.push_back((B << 4) | (C >> 2));
      |                     ^~~~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:136:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  136 |                 bin.push_back((C << 6) | (D));
      |                     ^~~~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:143:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  143 |                 bin.push_back((A << 2) | (B >> 4));
      |                     ^~~~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:144:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  144 |                 bin.push_back((B << 4) | (C >> 2));
      |                     ^~~~~~~~~
/home/raphy/licensecc/extern/license-generator/src/base_lib/base64.cpp:148:21: error: request for member ‘push_back’ in ‘bin’, which is of non-class type ‘int’
  148 |                 bin.push_back((A << 2) | (B >> 4));
      |                     ^~~~~~~~~
make[2]: *** [extern/license-generator/src/base_lib/CMakeFiles/lcc_base.dir/build.make:76: extern/license-generator/src/base_lib/CMakeFiles/lcc_base.dir/base64.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1168: extern/license-generator/src/base_lib/CMakeFiles/lcc_base.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
@bijwaard
Copy link

bijwaard commented Nov 12, 2024

You'll need to include cstdint in a number of places:

diff --git a/src/library/base/base64.h b/src/library/base/base64.h
index 466a263..e3beb0a 100644
--- a/src/library/base/base64.h
+++ b/src/library/base/base64.h
@@ -1,6 +1,7 @@
 #ifndef BASE64_H
 #define BASE64_H
 
+#include <cstdint>
 #include <string>
 #include <vector>
 
diff --git a/src/library/os/linux/cpu_info.cpp b/src/library/os/linux/cpu_info.cpp
index cfb4efc..2a356dc 100644
diff --git a/src/library/base/base64.h b/src/library/base/base64.h
index 466a263..e3beb0a 100644
--- a/src/library/base/base64.h
+++ b/src/library/base/base64.h
@@ -1,6 +1,7 @@
 #ifndef BASE64_H
 #define BASE64_H
 
+#include <cstdint>
 #include <string>
 #include <vector>
 
diff --git a/src/library/os/linux/cpu_info.cpp b/src/library/os/linux/cpu_info.cpp
index cfb4efc..2a356dc 100644
--- a/src/library/os/linux/cpu_info.cpp
+++ b/src/library/os/linux/cpu_info.cpp
@@ -6,6 +6,7 @@
  */
 
 #include <cpuid.h>
+#include <cstdint>
 #include <string>

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

No branches or pull requests

2 participants