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

gcc-5 compiler support on Travis-CI #1

Closed
cggos opened this issue Aug 25, 2017 · 1 comment
Closed

gcc-5 compiler support on Travis-CI #1

cggos opened this issue Aug 25, 2017 · 1 comment

Comments

@cggos
Copy link
Owner

cggos commented Aug 25, 2017

when I built this project on Travis-CI, I got errors of using deleted functions. After I search it on the Internet,I found it failed beacause of the wrong version of gcc/g++ and it should use gcc-5 to build. At the same time, I also found by the Travis-CI log that it was gcc-4.8 which was used to buid the project. So I had to set the compiler gcc-5.
I added the following code from the Internet to file .travis.yml.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

But it did NOT make a good job !!!

@cggos
Copy link
Owner Author

cggos commented Aug 25, 2017

I removed above code and added the following code. It really worked well !!!

sudo: required
script:
  - sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
  - sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-5 /usr/bin/g++
  - gcc --version
  - g++ --version
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - gcc-5
    - g++-5

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

1 participant