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

Fix bugs when using clang compiler #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zyjisdog
Copy link

@zyjisdog zyjisdog commented Mar 20, 2017

I use clang in windows 10 with visual studio 2015.
When I set “C Compiler” to clang, the gpp compiler can successfully compile and run C files without bugs.
But I can not run C++ files like above.
I set "C++ Compiler" to "clang++" or "clang" and without extra options, then gpp compiler successfully compiled the file but can not run after compile in cmd window, says "XX is not recognized as an internal or external command "
Finally, I fixed this bug with a change of source code in index.js -> getCompiledPath():

function getCompiledPath(dir, base) {
  debug("getCompiledPath()", dir, base);

  if (atom.config.get("gpp-compiler.compileToTmpDirectory")) {
    return path.join(os.tmpdir(), base);
  } else {
    const flag = atom.config.get("gpp-compiler.cppCompiler");
    if (flag == "clang" || flag == "clang++") {
      return path.join(dir,(base + ".exe"));
    }
    else {
      return path.join(dir, base);
    }
  }
}

Just a little change:)

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

Successfully merging this pull request may close these issues.

1 participant