XadillaX / thmclrx

:art: A theme color extractor module for Node.js.
http://blog.xcoder.in/thmclrx-stress-tester/result/
MIT License
205 stars 21 forks source link

CentOS 7.4 上编译错误 #7

Closed gaowhen closed 6 years ago

gaowhen commented 6 years ago
> thmclrx@1.0.0 install /node_modules/thmclrx
> node-gyp rebuild

make: Entering directory `/node_modules/thmclrx/build'
  CC(target) Release/obj.target/byakuren/deps/byakuren/byakuren.o
  CC(target) Release/obj.target/byakuren/deps/byakuren/common.o
  CC(target) Release/obj.target/byakuren/deps/byakuren/const/palette.o
In file included from ../deps/byakuren/const/palette.c:55:0:
../deps/byakuren/const/palette.h:62:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
 const extern bkr_palette_array _default_palette;
 ^
  CC(target) Release/obj.target/byakuren/deps/byakuren/lib/mindiff.o
In file included from ../deps/byakuren/lib/mindiff.c:56:0:
../deps/byakuren/lib/../const/palette.h:62:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
 const extern bkr_palette_array _default_palette;
 ^
../deps/byakuren/lib/mindiff.c: In function ‘_bkr_find_mindiff’:
../deps/byakuren/lib/mindiff.c:75:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for(uint32_t i = 0; i < palette_count; i++)
     ^
../deps/byakuren/lib/mindiff.c:75:5: note: use option -std=c99 or -std=gnu99 to compile your code
../deps/byakuren/lib/mindiff.c: In function ‘_bkr_mindiff_calc’:
../deps/byakuren/lib/mindiff.c:94:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for(uint32_t i = 0; i < pixel_count; i++)
     ^
../deps/byakuren/lib/mindiff.c:105:18: error: redefinition of ‘i’
     for(uint32_t i = 0; i < colored_count; i++)
                  ^
../deps/byakuren/lib/mindiff.c:94:18: note: previous definition of ‘i’ was here
     for(uint32_t i = 0; i < pixel_count; i++)
                  ^
../deps/byakuren/lib/mindiff.c:105:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for(uint32_t i = 0; i < colored_count; i++)
     ^
../deps/byakuren/lib/mindiff.c:112:18: error: redefinition of ‘i’
     for(uint32_t i = 0; i < grayed_count; i++)
                  ^
../deps/byakuren/lib/mindiff.c:105:18: note: previous definition of ‘i’ was here
     for(uint32_t i = 0; i < colored_count; i++)
                  ^
../deps/byakuren/lib/mindiff.c:112:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for(uint32_t i = 0; i < grayed_count; i++)
     ^
../deps/byakuren/lib/mindiff.c: In function ‘_bkr_generate_colored_and_gray_pelette’:
../deps/byakuren/lib/mindiff.c:152:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for(uint32_t i = 0; i < palette->count; i++)
         ^
../deps/byakuren/lib/mindiff.c:165:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for(uint32_t i = 0; i < palette->count; i++)
         ^
make: *** [Release/obj.target/byakuren/deps/byakuren/lib/mindiff.o] Error 1
make: Leaving directory `/node_modules/thmclrx/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 3.10.0-693.21.1.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gaowhen/suede/server/node_modules/thmclrx
gyp ERR! node -v v9.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! thmclrx@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the thmclrx@1.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
galaa2011 commented 6 years ago

@gaowhen 老兄 这个你是怎么解决的,就是去改代码了吗?

gaowhen commented 6 years ago

@galaa2011

CFLAGS='-std=c99' npm install