更改了默认的gcc版本,现在正在编译问题

时间:2015-10-13 14:54:03

标签: c++ node.js gcc atom-editor

对于安装,我必须更改我的默认gcc编译器版本。我对我使用的版本有一些编译问题所以我通过macports下载了其他几个版本,其中一个版本最终用于我的安装。

我几乎可以肯定我之前使用的是gcc4.2,在我的端口中列为:llvm-gcc42。

在另外两种情况下,我现在面临c ++文件的编译问题。我不熟悉c ++,我只使用编译器来编译一些 - 主要是node.js - 模块,或者现在是原子编辑器的包。

这是我得到的,这让我觉得c ++编译器的某些东西不正确:

cc1plus:错误:无法识别的命令行选项“-std = gnu ++ 0x”

我可以通过更改默认的gcc版本来摆脱这种情况。但我不能每次尝试多个版本。

那么:我应该使用哪个gcc版本,还是有什么可能导致这个? gcc5,最新给我的相同......

在特定情况下:安装termrk的问题(原子编辑器的模块)

mysqldump -u username -p dbname > db_dump.sql

CREATE TABLE `acesso_sistema` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ip_acesso` varchar(15) COLLATE latin1_general_ci NOT NULL,
  `id_usuario_acesso` int(11) NOT NULL,
  `unidade` varchar(30) CHARACTER SET latin1 NOT NULL,
  `operadora` varchar(35) COLLATE latin1_general_ci NOT NULL,
  `host_by_addr` varchar(35) COLLATE latin1_general_ci NOT NULL,
  `id_usuario` int(11) NOT NULL,
  `data_now` datetime NOT NULL,
  `ip` varchar(15) COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

有两种方法可以安装原子包:在编辑器中使用gui和命令行工具apm。两者都不起作用,但我收到不同的错误消息。

1。在gui里面:

gcc --version
gcc (MacPorts gcc5 5.2.0_0) 5.2.0
[...]

1。在终端:

> pty.js@0.2.13 install /private/var/folders/nl/2ppbw8fn0cjbw04pdqbxmqtr0000gn/T/apm-install-dir-115913-1105-1g6fykw/node_modules/Termrk/node_modules/pty.js
> node-gyp rebuild

  CXX(target) Release/obj.target/pty/src/unix/pty.o

cc1plus: error: unrecognized command line option "-std=gnu++0x"
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 12.6.0
gyp ERR! command "node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/var/folders/nl/2ppbw8fn0cjbw04pdqbxmqtr0000gn/T/apm-install-dir-115913-1105-1g6fykw/node_modules/Termrk/node_modules/pty.js
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 
npm ERR! Darwin 12.6.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/michael/.atom/.apm/.apmrc" "--userconfig" "/Users/michael/.atom/.apmrc" "install" "/private/var/folders/nl/2ppbw8fn0cjbw04pdqbxmqtr0000gn/T/d-115913-1105-1hg4ytj/package.tgz" "--target=0.30.7" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! pty.js@0.2.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pty.js@0.2.13 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/nl/2ppbw8fn0cjbw04pdqbxmqtr0000gn/T/apm-install-dir-115913-1105-1g6fykw/npm-debug.log

1 个答案:

答案 0 :(得分:0)

这是GCC 5.2的有效选项,因此,如果它说它未被识别,则表示您没有使用GCC 5.2。

您可能仍在使用旧的GCC 4.2版本进行编译。