Giter Site home page Giter Site logo

C++17 issue about issues HOT 12 CLOSED

cevelop avatar cevelop commented on July 19, 2024
C++17 issue

from issues.

Comments (12)

PeterSommerlad avatar PeterSommerlad commented on July 19, 2024

Hi,
while clang 5 supports the flag -std=c++17, Apple's XCode's clang does not. If you have clang 5 installed via homebrew or similar, you might call XCode's clang instead. Please check Cevelop's preferences/C++/Build/Environment and examine the PATH environment variable. If your clang 5 is installed in /usr/local/bin, but PATH contains /usr/bin in the front, Cevelop will call XCode's Clang. Set the PATH environment variable within Cevelop to have the installation location of your Clang 5 in the front, then the option -std=c++17 should work.

Regards
Peter.

from issues.

aacirino avatar aacirino commented on July 19, 2024

Hi Peter, actually it didn't solve the issue. The PATH environment variable wasn't set up in Cevelop and I entered it accordingly to my clang 5.0 installation but the issue remains. In the command line the PATH is correct as can be seen from issuing a simple command:
Hackintosh:~ aacirino$ clang++ -v
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

from issues.

PeterSommerlad avatar PeterSommerlad commented on July 19, 2024

From the Cevelop UI you need to copy the PATH environment variable, even when it is not set directly and then set it to what you need. The settings in your shell are not influencing the settings in an app. Is your setting something like on the attached image?
screen shot 2017-11-03 at 13 48 16

I had similar problems in the past and I am sure that is a problem with your mac set up and not a bug in Cevelop.

What happens in your shell when you enter the command which clang++?

from issues.

tcorbat avatar tcorbat commented on July 19, 2024

If Peter's suggestion does not help:
Could you try adding the "-v" option to the clang command within Cevelop? You should be able to insert into the miscellaneous options in the build settings, similar as you did for the -std=c++17 flags. It won't compile the files with that option anymore, but it will print the version on the build console. Does it print the same?

from issues.

aacirino avatar aacirino commented on July 19, 2024

To simplify the setting I only included the path to clang5.0 in Cevelop:

path

The path is the same for the command line:
Hackintosh:~ aacirino$ which clang++
/usr/local/opt/llvm/bin/clang++

Using the -v option shows that Cevelop is indeed invoking Apple's clang instead of using the one installed in the above PATH:
clang++ -I/usr/local/include -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -v -std=c++17 -o Person.bc ../Person.cpp
Apple LLVM version 8.0.0 (clang-800.0.42.1)

from issues.

aacirino avatar aacirino commented on July 19, 2024

I was able to circumvent the issue by setting the LLVM Clang++ command and linker setting explicitly to /usr/local/opt/llvm/bin/clang++

from issues.

tcorbat avatar tcorbat commented on July 19, 2024

It is possible that Cevelop separately set the environment for the project. There are two locations to set the build environment:

  • Preferences (globally for the workspace), accessed by Apple menu -> preferences
  • Properties (specific settings for the project), accessed by right-click on the project -> properties

Have you set the PATH variable in the properties?

from issues.

aacirino avatar aacirino commented on July 19, 2024

Solved, in the project settings -> C/C++ Build -> Environment -> PATH the dir order was wrong. In the global preferences the PATH was correctly set, but not in the project settings.
Thanx a lot

from issues.

tcorbat avatar tcorbat commented on July 19, 2024

Great that it works now!
I think this might be a candidate for our FAQ.

from issues.

aacirino avatar aacirino commented on July 19, 2024

As a final note, I've just created a new project. In the global preferences my build environment variable PATH is correctly set and I selected the option to "Replace native environment with specified one". But Cevelop created the project with the PATH variable as appended with my global PATH:

global PATH : /usr/local/opt/llvm/bin/

project PATH : /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/llvm/bin/

Of course for the clang5.0 to be used by Cevelop I will need to edit the project PATH.

IMO this isn't the desired behavior.

from issues.

Darnor avatar Darnor commented on July 19, 2024

We'll look into this.

from issues.

Darnor avatar Darnor commented on July 19, 2024

This is an upstream issue, I've opened a new bug report here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=528891

from issues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.