Build Failure on Linux with Python 3.3 and gcc 4.6.3 #25

Closed
opened 2026-01-29 20:29:13 +00:00 by claunia · 1 comment
Owner

Originally created by @wbond on GitHub (Sep 22, 2015).

Is this due to having an older version of GCC?

~/src/brotli$ python3 setup.py build
running build
running build_ext
creating build
creating build/temp.linux-x86_64-3.3
creating build/temp.linux-x86_64-3.3/dec
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/bit_reader.c -o build/temp.linux-x86_64-3.3/dec/bit_reader.o
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/decode.c -o build/temp.linux-x86_64-3.3/dec/decode.o
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/huffman.c -o build/temp.linux-x86_64-3.3/dec/huffman.o
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/streams.c -o build/temp.linux-x86_64-3.3/dec/streams.o
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/state.c -o build/temp.linux-x86_64-3.3/dec/state.o
creating build/temp.linux-x86_64-3.3/python
creating build/temp.linux-x86_64-3.3/enc
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c python/brotlimodule.cc -o build/temp.linux-x86_64-3.3/python/brotlimodule.o -std=c++0x
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
In file included from python/../enc/encode.h:28:0,
                 from python/brotlimodule.cc:4:
python/../enc/./streams.h:59:44: error: expected ‘;’ at end of member declaration
python/../enc/./streams.h:59:46: error: ‘override’ does not name a type
python/../enc/./streams.h:77:39: error: expected ‘;’ at end of member declaration
python/../enc/./streams.h:77:41: error: ‘override’ does not name a type
python/../enc/./streams.h:95:39: error: expected ‘;’ at end of member declaration
python/../enc/./streams.h:95:41: error: ‘override’ does not name a type
python/../enc/./streams.h:108:48: error: expected ‘;’ at end of member declaration
python/../enc/./streams.h:108:50: error: ‘override’ does not name a type
python/../enc/./streams.h:121:39: error: expected ‘;’ at end of member declaration
python/../enc/./streams.h:121:41: error: ‘override’ does not name a type
error: command 'gcc' failed with exit status 1
~/src/brotli$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Originally created by @wbond on GitHub (Sep 22, 2015). Is this due to having an older version of GCC? ``` bash ~/src/brotli$ python3 setup.py build running build running build_ext creating build creating build/temp.linux-x86_64-3.3 creating build/temp.linux-x86_64-3.3/dec gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/bit_reader.c -o build/temp.linux-x86_64-3.3/dec/bit_reader.o gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/decode.c -o build/temp.linux-x86_64-3.3/dec/decode.o gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/huffman.c -o build/temp.linux-x86_64-3.3/dec/huffman.o gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/streams.c -o build/temp.linux-x86_64-3.3/dec/streams.o gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c dec/state.c -o build/temp.linux-x86_64-3.3/dec/state.o creating build/temp.linux-x86_64-3.3/python creating build/temp.linux-x86_64-3.3/enc gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c python/brotlimodule.cc -o build/temp.linux-x86_64-3.3/python/brotlimodule.o -std=c++0x cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default] In file included from python/../enc/encode.h:28:0, from python/brotlimodule.cc:4: python/../enc/./streams.h:59:44: error: expected ‘;’ at end of member declaration python/../enc/./streams.h:59:46: error: ‘override’ does not name a type python/../enc/./streams.h:77:39: error: expected ‘;’ at end of member declaration python/../enc/./streams.h:77:41: error: ‘override’ does not name a type python/../enc/./streams.h:95:39: error: expected ‘;’ at end of member declaration python/../enc/./streams.h:95:41: error: ‘override’ does not name a type python/../enc/./streams.h:108:48: error: expected ‘;’ at end of member declaration python/../enc/./streams.h:108:50: error: ‘override’ does not name a type python/../enc/./streams.h:121:39: error: expected ‘;’ at end of member declaration python/../enc/./streams.h:121:41: error: ‘override’ does not name a type error: command 'gcc' failed with exit status 1 ``` ``` bash ~/src/brotli$ gcc --version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
Author
Owner

@fcharlie commented on GitHub (Sep 23, 2015):

This class ,override is a c++11 key word
Support "override" keyword require GCC 4.7 or later

class BrotliMemIn : public BrotliIn {
 public:
  BrotliMemIn(const void* buf, int len);

  void Reset(const void* buf, int len);

  // returns the amount of data consumed
  int position() const { return pos_; }

  const void* Read(size_t n, size_t* OUTPUT) override;

 private:
  const void* buf_;  // start of input buffer
  int len_;  // length of input
  int pos_;  // current read position within input
};

// Adapter class to make BrotliOut objects from raw memory.
class BrotliMemOut : public BrotliOut {
 public:
  BrotliMemOut(void* buf, int len);

  void Reset(void* buf, int len);

  // returns the amount of data written
  int position() const { return pos_; }

  bool Write(const void* buf, size_t n) override;

 private:
  void* buf_;  // start of output buffer
  int len_;  // length of output
  int pos_;  // current write position within output
};

Explicit virtual overrides N2928 N3206 N3272 GCC 4.7
https://gcc.gnu.org/projects/cxx0x.html

@fcharlie commented on GitHub (Sep 23, 2015): This class ,override is a c++11 key word Support "override" keyword require GCC 4.7 or later ``` class BrotliMemIn : public BrotliIn { public: BrotliMemIn(const void* buf, int len); void Reset(const void* buf, int len); // returns the amount of data consumed int position() const { return pos_; } const void* Read(size_t n, size_t* OUTPUT) override; private: const void* buf_; // start of input buffer int len_; // length of input int pos_; // current read position within input }; // Adapter class to make BrotliOut objects from raw memory. class BrotliMemOut : public BrotliOut { public: BrotliMemOut(void* buf, int len); void Reset(void* buf, int len); // returns the amount of data written int position() const { return pos_; } bool Write(const void* buf, size_t n) override; private: void* buf_; // start of output buffer int len_; // length of output int pos_; // current write position within output }; ``` Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 https://gcc.gnu.org/projects/cxx0x.html
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#25