Skip to content
This repository was archived by the owner on Mar 27, 2020. It is now read-only.

Manual intervention via makeflags necessary to enable C++11 #88

Closed
nooitaf opened this issue Oct 11, 2018 · 7 comments
Closed

Manual intervention via makeflags necessary to enable C++11 #88

nooitaf opened this issue Oct 11, 2018 · 7 comments
Labels

Comments

@nooitaf
Copy link

nooitaf commented Oct 11, 2018

Thanks for this package :)

i got this error while compiling and did not know how to solve it at first..

$ cmake -DCEF_ROOT_DIR=../../cef_binary_3.3325.1750.gaabe4c4_linux64_minimal ..
[ ...]
[ 36%] Building CXX object CMakeFiles/browser_shared.dir/src/browser/browser-app.cpp.o
In file included from /usr/include/c++/5/unordered_map:35:0,
                 from /home/nooitaf/repos/obs-linuxbrowser/src/browser/browser-app.cpp:27:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^

I just solved it by adding -DCMAKE_CXX_FLAGS="-std=c++11" to the cmake command:

cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCEF_ROOT_DIR=CEF_ROOT_PATH ..

Builds fine now :)

Maybe this could be added to the docs for noobs like me who dont compile every day :D

@NexAdn
Copy link
Collaborator

NexAdn commented Oct 11, 2018

set(LINUXBROWSER_CXX_FEATURES
cxx_std_11
cxx_auto_type
cxx_constexpr
cxx_deleted_functions
cxx_nullptr
cxx_override
cxx_range_for
)

As you can see we actually have C++11 enabled. I wonder how it happened that you weren't able to compile without manually setting the appropriate flag. Did you compile from master?

@NexAdn NexAdn changed the title requires compiler and libary support for the iso c++ 2011 standard : solved Manual intervention via makeflags necessary to enable C++11 Oct 11, 2018
@nooitaf
Copy link
Author

nooitaf commented Oct 12, 2018

Yes, i compiled from master :\

@NexAdn NexAdn added the bug label Oct 12, 2018
@NexAdn
Copy link
Collaborator

NexAdn commented Oct 12, 2018

Could you please provide information about your OS? And it might help if you try to re-download the repo and compile again without manually adding -DCMAKE_CXX_FLAGS=-std=c++11" and calling make VERBOSE=true instead of just make. I'd like to see what console output you get when doing this. Best would be uploading it to Gist, Pastebin, etc. so that it doesn't clutter this conversation.

Thanks in advance

@nooitaf
Copy link
Author

nooitaf commented Oct 12, 2018

Sure, glad to help:

$ lsb_release -a
Distributor ID:	LinuxMint
Description:	Linux Mint 18.3 Sylvia
Release:	18.3
Codename:	sylvia

$ uname -a
Linux nooitbox 4.15.0-36-generic #39~16.04.1-Ubuntu SMP Tue Sep 25 08:59:23 UTC 2018 x86_64 GNU/Linux

https://gist.github.com/nooitaf/218af84bcf096f8f0477609698462bc2

@NexAdn
Copy link
Collaborator

NexAdn commented Oct 12, 2018

Seems like you are using an older compiler version (GCC 5.x). The build is designed to work out of the box when using current compiler versions (GCC 8.x on Arch). I believe Mint provides a GCC package gcc-8 or similar (don't know the exact name as I don't use Mint/Ub/Deb). Maybe there also is a package that always provides the most recent stable release. Try sticking with such packages (unless explicitly stated!), as older compiler versions can cause problems like the one you experienced.

I will include your issue in the known issues section.

@NexAdn NexAdn closed this as completed Oct 12, 2018
@NexAdn NexAdn added wontfix and removed bug labels Oct 12, 2018
@nooitaf
Copy link
Author

nooitaf commented Oct 12, 2018

Ah that explains it. Thanks
Mint 18.3 (latest version) doesn't go higher then version 5.4

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

As i use linuxbrew i installed gcc-8 with brew install gcc@8
I now have a gcc-8 available

$ gcc-8 --version
gcc-8 (Homebrew GCC 8.2.0) 8.2.0

But just make still doesn't work. How would i switch to gcc-8? Alias it?
Just courious.

@NexAdn
Copy link
Collaborator

NexAdn commented Oct 12, 2018

Unfortunately I don't have any experience with Mint and I can't help you with this one, but maybe Google has a working solution for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants