Libgourou

Issue 52: Build errors

Reported by Francesco Turco, Apr 29, 2023

Steps to reproduce the problem:
1. Clone the git repository for libgourou
2. Run "make"

Actual result:

Building libgourou 0.8.1
mkdir lib
./scripts/setup.sh
Cloning into 'lib/updfparser'...
~/tmp/libgourou/lib/updfparser ~/tmp/libgourou
make[1]: Entering directory 
'/home/fturco/tmp/libgourou/lib/updfparser'
mkdir obj
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include -O2 -c 
src/uPDFParser.cpp -o obj/uPDFParser.o
In file included from ./include/uPDFParser.h:34,
                 from src/uPDFParser.cpp:26:
./include/uPDFObject.h:49:52: error: 'uint64_t' has not been 
declared
   49 |         Object(int objectId, int generationNumber, uint64_t 
offset, bool isNew=false,
      |                                                    ^~~~~~~~
make[1]: *** [Makefile:41: obj/uPDFParser.o] Error 1
make[1]: Leaving directory 
'/home/fturco/tmp/libgourou/lib/updfparser'
~/tmp/libgourou
mkdir obj
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/libgourou.cpp -o obj/libgourou.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/user.cpp -o obj/user.o
In file included from src/user.cpp:20:
./include/libgourou.h:219:37: error: 'uint8_t' has not been declared
  219 |         void pushTag(void* sha_ctx, uint8_t tag);
      |                                     ^~~~~~~
make: *** [Makefile:75: obj/user.o] Error 1

Other informations:
- Distribution: Gentoo Linux (~amd64)
- Compiler: GCC 13.1.0
- SSL/TLS library: OpenSSL 3.0.8

A few days ago I upgraded gcc to the current version (13.1.0). 
Before the upgrade, I had no problems building libgourou...

Comment 1 by Grégory Soutadé, Apr 29, 2023

Hi,

It's just stdint.h that is missing. I created a branch 
"turco" (in both libgourou and uPDFParser repo) to fix 
this error and maybe other... Can you try it ? Thanks

Status: Started

Comment 2 by Francesco Turco, Apr 29, 2023

I switched both git repositories to the "turco" branch, 
then issued "make clean" and finally "make":

Building libgourou 0.8.1
mkdir obj
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/libgourou.cpp -o obj/libgourou.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/user.cpp -o obj/user.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/device.cpp -o obj/device.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/fulfillment_item.cpp -o obj/fulfillment_item.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/loan_token.cpp -o obj/loan_token.o
x86_64-pc-linux-gnu-g++ -Wall -fPIC -I./include 
-I./usr/include/pugixml -I./lib/updfparser/include -O2 -c 
src/bytearray.cpp -o obj/bytearray.o
In file included from src/bytearray.cpp:22:
./include/Base64.h: In static member function 'static std::string 
macaron::Base64::Decode(const std::string&, std::string&)':
./include/Base64.h:113:7: error: 'uint32_t' was not declared in this 
scope
  113 |       uint32_t a = input[i] == '=' ? 0 & i++ : 
kDecodingTable[static_cast<int>(input[i++])];
      |       ^~~~~~~~
./include/Base64.h:1:1: note: 'uint32_t' is defined in header 
'<cstdint>'; did you forget to '#include <cstdint>'?
  +++ |+#include <cstdint>
    1 | #ifndef _MACARON_BASE64_H_
./include/Base64.h:114:16: error: expected ';' before 'b'
  114 |       uint32_t b = input[i] == '=' ? 0 & i++ : 
kDecodingTable[static_cast<int>(input[i++])];
      |                ^
./include/Base64.h:115:16: error: expected ';' before 'c'
  115 |       uint32_t c = input[i] == '=' ? 0 & i++ : 
kDecodingTable[static_cast<int>(input[i++])];
      |                ^
./include/Base64.h:116:16: error: expected ';' before 'd'
  116 |       uint32_t d = input[i] == '=' ? 0 & i++ : 
kDecodingTable[static_cast<int>(input[i++])];
      |                ^
./include/Base64.h:118:16: error: expected ';' before 'triple'
  118 |       uint32_t triple = (a << 3 * 6) + (b << 2 * 
6) + (c << 1 * 6) + (d << 0 * 6);
      |                ^~~~~~
./include/Base64.h:120:36: error: 'trip

Comment 3 by Grégory Soutadé, Apr 29, 2023

I missed this one...

Comment 4 by Francesco Turco, Apr 30, 2023

OK, libgourou now builds correctly. Thank you!
I'll update my Gentoo ebuild for libgourou as soon as you merge 
these commits into the master branch.

Comment 5 by Grégory Soutadé, May 3, 2023

Nice. Rebased now.

Status: Fixed

Created: 4 months 25 days ago by Francesco Turco

Updated: 4 months 19 days ago

Status: Fixed

Followed by: 1 person

Labels:
Priority:Medium
Type:Defect