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

Building with GCC 4.6 fails #2989

Closed
hibariya opened this issue Sep 11, 2019 · 2 comments
Closed

Building with GCC 4.6 fails #2989

hibariya opened this issue Sep 11, 2019 · 2 comments

Comments

@hibariya
Copy link

hibariya commented Sep 11, 2019

Hello. While README.md suggests LibSass supports GCC 4.6 or higher, it seems that the current master cannot be built with GCC 4.6. I tried to build LibSass master (8e22cd4) today and got an error as follows:

$ docker run --rm -it --volume=$(pwd):/work --workdir=/work gcc:4.6 bash
root@67341c3a431e:/work# make                                                                                                                                                                 
cc -Wall -O2 -DLIBSASS_VERSION="\"3.6.1-42-g8e22\"" -I /work/include  -fPIC -c -o src/cencode.o src/cencode.c
g++ -Wall -O2 -DLIBSASS_VERSION="\"3.6.1-42-g8e22\"" -std=c++11 -I /work/include  -fPIC -c -o src/ast.o src/ast.cpp
cc1plus: error: unrecognized command line option '-std=c++11'
make: *** [src/ast.o] Error 1

According to the error message above, GCC 4.6 cannot recognize the option -std=c++11. However, even if I change the flag with -std=c++0x (by reverting c87a63e), I got another error as below:

$ docker run --rm -it --volume=$(pwd):/work --workdir=/work gcc:4.6 bash
root@8074fc389378:/work# make
cc -Wall -O2 -DLIBSASS_VERSION="\"3.6.1-43-gfab7\"" -I /work/include  -fPIC -c -o src/cencode.o src/cencode.c
g++ -Wall -O2 -DLIBSASS_VERSION="\"3.6.1-43-gfab7\"" -std=c++0x -I /work/include  -fPIC -c -o src/ast.o src/ast.cpp
In file included from src/ast_fwd_decl.hpp:9:0,
                 from src/ast.hpp:13,
                 from src/ast.cpp:5:
src/memory/SharedPtr.hpp: In copy constructor 'Sass::SharedPtr::SharedPtr(const Sass::SharedPtr&)':
src/memory/SharedPtr.hpp:116:39: error: type 'Sass::SharedPtr' is not a direct base of 'Sass::SharedPtr'
src/memory/SharedPtr.hpp: In function 'bool Sass::operator<(const Sass::SharedImpl<T1>&, const Sass::SharedImpl<T2>&)':
src/memory/SharedPtr.hpp:239:11: error: expected nested-name-specifier before 'CT'
src/memory/SharedPtr.hpp:239:11: error: 'CT' has not been declared
src/memory/SharedPtr.hpp:239:14: error: expected ';' before '=' token
src/memory/SharedPtr.hpp:239:14: error: expected primary-expression before '=' token
src/memory/SharedPtr.hpp:239:57: error: expected '(' before ';' token
src/memory/SharedPtr.hpp:240:22: error: 'CT' was not declared in this scope
src/memory/SharedPtr.hpp:240:24: error: template argument 1 is invalid
In file included from src/ast.cpp:5:0:
src/ast.hpp: At global scope:
src/ast.hpp:175:5: error: expected ';' at end of member declaration
src/ast.hpp:175:5: error: 'override' does not name a type
src/ast.hpp:175:5: error: expected ';' at end of member declaration
src/ast.hpp:175:5: error: 'override' does not name a type
src/ast.hpp:176:19: error: expected ';' at end of member declaration
src/ast.hpp:176:25: error: 'override' does not name a type
In file included from src/ast.cpp:5:0:
src/ast.hpp:495:5: error: expected ';' at end of member declaration
src/ast.hpp:495:5: error: 'override' does not name a type
src/ast.hpp:495:5: error: expected ';' at end of member declaration
src/ast.hpp:495:5: error: 'override' does not name a type
src/ast.hpp:502:21: error: expected initializer before ':' token
src/ast.cpp:953:1: error: expected '}' at end of input
src/units.hpp:11:16: warning: 'Sass::PI' defined but not used [-Wunused-variable]
make: *** [src/ast.o] Error 1

Incidentally, building with GCC 4.7 finished without errors.

@mgreter
Copy link
Contributor

mgreter commented Sep 11, 2019

Seems this was broken by #2741 and #2742

@glebm
Copy link
Contributor

glebm commented Sep 16, 2019

I've updated the Readme to mention that GCC 4.7+ is required.

GCC 4.6 doesn't fully support C++11, supporting it on an ongoing basis would be quite a bit of work.

I think we should just specify "any C++11 compiler" instead of particular compiler versions (the first GCC with full C++11 support is v4.8.1, except a few libraries such as <regex>).

Incidentally, GCC 4.6.0 was released in 2011, before even VS 2013 (which I hope we can also drop support for for the next major release), and the last update to the 4.6 line was in 2013.

@mgreter mgreter closed this as completed Jan 17, 2020
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

3 participants