is valid only in a c99 compilation environment." 上构建 Node.JS-6ren"> is valid only in a c99 compilation environment." 上构建 Node.JS-我正在尝试在 Solaris 上安装 Node.JS。这是开箱即用的 Solaris 9/10 x86(最新的是 2010 年 9 月)并且仅使用默认包。 我遵循的指示在这里:https://gith-6ren">
gpt4 book ai didi

c - 在 Solaris : "Use of is valid only in a c99 compilation environment." 上构建 Node.JS

转载 作者:搜寻专家 更新时间:2023-11-01 00:26:59 25 4
gpt4 key购买 nike

我正在尝试在 Solaris 上安装 Node.JS。这是开箱即用的 Solaris 9/10 x86(最新的是 2010 年 9 月)并且仅使用默认包。

我遵循的指示在这里:https://github.com/joyent/node/wiki/Installation .我正在使用在他们的主页上找到的最新稳定版本的 Node.JS http://nodejs.org

这是我试过的...

-bash-3.00# export PATH=$PATH:/usr/sfw/bin:/usr/xpg4/bin
-bash-3.00# ./configure --prefix=/tmp/node
Checking for program g++ or c++ : /usr/sfw/bin/g++
Checking for program cpp : /usr/sfw/bin/cpp
Checking for program ar : /usr/xpg4/bin/ar
Checking for program ranlib : not found
Checking for g++ : ok
Checking for program gcc or cc : /usr/sfw/bin/gcc
Checking for program ar : /usr/xpg4/bin/ar
Checking for program ranlib : not found
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : yes
Checking for library util : not found
Checking for library rt : yes
Checking for library socket : yes
Checking for library nsl : yes
--- libeio ---
Checking for library pthread : yes
Checking for function pthread_create : yes
Checking for function pthread_atfork : yes
Checking for futimes(2) : no
Checking for readahead(2) : no
Checking for fdatasync(2) : no
Checking for pread(2) and pwrite(2) : yes
Checking for sendfile(2) : no
Checking for sync_file_range(2) : no
--- libev ---
Checking for header sys/inotify.h : not found
Checking for header sys/epoll.h : not found
Checking for header port.h : yes
Checking for function port_create : yes
Checking for header poll.h : yes
Checking for function poll : yes
Checking for header sys/event.h : not found
Checking for header sys/queue.h : yes
Checking for function kqueue : not found
Checking for header sys/select.h : yes
Checking for function select : yes
Checking for header sys/eventfd.h : not found
Checking for SYS_clock_gettime : no
Checking for library rt : yes
Checking for function clock_gettime : yes
Checking for function nanosleep : yes
Checking for function ceil : yes
Checking for fdatasync(2) with c++ : no
'configure' finished successfully (1.936s)
-bash-3.00# make
Waf: Entering directory `/tmp/node-v0.4.3/build'
DEST_OS: sunos
DEST_CPU: ia32
Parallel Jobs: 1
Product type: program
[ 3/75] cc: deps/c-ares/ares_strcasecmp.c -> build/default/deps/c-ares/ares_strcasecmp_1.o
/usr/sfw/bin/gcc -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -threads -m32 -g -O3 -DHAVE_OPENSSL=1 -DEV_FORK_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_MULTIPLICITY=0 -DX_STACKSIZE=65536 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DEV_MULTIPLICITY=0 -DHAVE_FDATASYNC=0 -DPLATFORM="sunos" -D__POSIX__=1 -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -DNDEBUG -Idefault/deps/c-ares -I../deps/c-ares -Idefault/deps/c-ares/sunos-ia32 -I../deps/c-ares/sunos-ia32 ../deps/c-ares/ares_strcasecmp.c -c -o default/deps/c-ares/ares_strcasecmp_1.o
In file included from ../deps/c-ares/setup_once.h:73,
from ../deps/c-ares/sunos-ia32/ares_setup.h:195,
from ../deps/c-ares/ares_strcasecmp.c:18:
/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."
Waf: Leaving directory `/tmp/node-v0.4.3/build'
Build failed: -> task failed (err #1):
{task: cc ares_strcasecmp.c -> ares_strcasecmp_1.o}
*** Error code 1
The following command caused the error:
python tools/waf-light --product-type=program build
make: Fatal error: Command failed for target `program'
-bash-3.00#

我认为关键错误是

/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."

我可以这样重现

-bash-3.00# cd build
-bash-3.00# /usr/sfw/bin/gcc -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -threads -m32 -g -O3 -DHAVE_OPENSSL=1 -DEV_FORK_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_MULTIPLICITY=0 -DX_STACKSIZE=65536 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DEV_MULTIPLICITY=0 -DHAVE_FDATASYNC=0 -DPLATFORM="sunos" -D__POSIX__=1 -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -DNDEBUG -Idefault/deps/c-ares -I../deps/c-ares -Idefault/deps/c-ares/sunos-ia32 -I../deps/c-ares/sunos-ia32 ../deps/c-ares/ares_strcasecmp.c -c -o default/deps/c-ares/ares_strcasecmp_1.o
In file included from ../deps/c-ares/setup_once.h:73,
from ../deps/c-ares/sunos-ia32/ares_setup.h:195,
from ../deps/c-ares/ares_strcasecmp.c:18:
/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."
-bash-3.00# cd ..
-bash-3.00#

有什么想法吗?我是否需要指定不同的选项来使用 C99 或不使用 C99?

同样,这是开箱即用的 x86 上的 Solaris 9/10。我没有做任何会改变任何编译器或与此相关的任何其他默认安装的东西。

最佳答案

在调用 ./configure 之前尝试将 -std=c99-std=gnu99 添加到您的 CFLAGS ,像这样:

CFLAGS=-std=c99 ./configure --prefix=/tmp/node

这个错误意味着 Node.JS 可能在它的 configure.ac 脚本中使用了 AC_PROG_CC 而它应该使用 AC_PROG_CC_C99,见 the page on C compiler detection on autoconf's manual .您应该向 Node.JS 开发人员报告此错误,并测试正确的解决方案是否适用于您的系统。

关于c - 在 Solaris : "Use of <stdbool.h> is valid only in a c99 compilation environment." 上构建 Node.JS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5363042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com