Skip to content

Fix bugs when using clang compiler#90

Open
zyjisdog wants to merge 1 commit intokriscross07:masterfrom
zyjisdog:master
Open

Fix bugs when using clang compiler#90
zyjisdog wants to merge 1 commit intokriscross07:masterfrom
zyjisdog:master

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