我试图为Windows CE交叉编译NodeJS,我似乎无法弄明白。我们希望使用飞思卡尔ARM1136-MX35处理器在设备上运行Node。
我尝试过使用cegcc但无济于事,我也尝试使用./configure --without-npm --without-ssl --without-snapshot --dest-cpu=arm --dest-os=win
进行配置,但错误太多了。有没有人为Windows CE编译Node有什么成功?
这是我使用普通gcc获得的错误:
root@kevin-vm:~/node-v0.10.26# make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/root/node-v0.10.26/out'
g++ '-DNODE_WANT_INTERNALS=1' '-DARCH="arm"' '-DPLATFORM="linux"' '-DNODE_TAG=""' '-DHAVE_OPENSSL=0' '-DHAVE_ETW=1' '-DHAVE_PERFCTR=1' '-D__POSIX__' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_POSIX_C_SOURCE=200112' -I../src -I../tools/msvs/genfiles -I../deps/uv/src/ares -I/root/node-v0.10.26/out/Release/obj/gen -I../deps/v8/include -I../deps/zlib -I../deps/http_parser -I../deps/cares/include -I../deps/uv/include -Wall -Wextra -Wno-unused-parameter -pthread -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF /root/node-v0.10.26/out/Release/.deps//root/node-v0.10.26/out/Release/obj.target/node/src/node.o.d.raw -c -o /root/node-v0.10.26/out/Release/obj.target/node/src/node.o ../src/node.cc
In file included from ../src/node_counters.h:36:0,
from ../src/node.cc:35:
../src/node_win32_perfctr_provider.h:33:8: error: ‘HANDLE’ does not name a type
../src/node_win32_perfctr_provider.h: In function ‘bool node::NODE_COUNTER_ENABLED()’:
../src/node_win32_perfctr_provider.h:35:45: error: ‘NodeCounterProvider’ was not declared in this scope
make[1]: *** [/root/node-v0.10.26/out/Release/obj.target/node/src/node.o] Error 1
make[1]: Leaving directory `/root/node-v0.10.26/out'
make: *** [node] Error 2
使用cegcc:
root@kevin-vm:~/node-v0.10.26# make
/usr/bin/python tools/gyp_node.py -f make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/root/node-v0.10.26/out'
arm-cegcc-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DHAVE_CONFIG_H' '-DCARES_STATICLIB' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux -Wall -Wextra -Wno-unused-parameter -pthread -g --std=gnu89 -pedantic -Wall -Wextra -Wno-unused-parameter -O2 -fno-strict-aliasing -fno-tree-vrp -fno-tree-sink -fno-omit-frame-pointer -MMD -MF /root/node-v0.10.26/out/Release/.deps//root/node-v0.10.26/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw -c -o /root/node-v0.10.26/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
arm-cegcc-gcc: unrecognized option '-pthread'
/bin/../libexec/gcc/arm-cegcc/4.4.0/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make[1]: *** [/root/node-v0.10.26/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o] Error 1
make[1]: Leaving directory `/root/node-v0.10.26/out'
make: *** [node] Error 2
编辑: 我们公司决定停止使用Windows CE产品并切换到嵌入式Linux系统(ARMv6),并在那里运行0.12.2就好了。