justadudewhohacks / justadudewhohacks/opencv4nodejs

error compiling with gcc 9 and disabled autobuild

Open
#631 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

# Error Message

```
CXX(target) Release/obj.target/opencv4nodejs/cc/core/Mat.o
In file included from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/utils.h:3,
from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/AbstractConverter.h:1,
from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/NativeNodeUtils.h:1,
from ../cc/macros.h:1,
from ../cc/opencv_modules.h:1,
from ../cc/core/Mat.cc:1:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_wor
k_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
2298 | , reinterpret_cast(AsyncExecuteComplete)
| ^
In file included from /home/ubuntu/.node-gyp/10.14.0/include/node/node.h:63,
from ../node_modules/nan/nan.h:54,
from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/utils.h:3,
from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/AbstractConverter.h:1,
from /usr/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/NativeNodeUtils.h:1,
from ../cc/macros.h:1,
from ../cc/opencv_modules.h:1,
from ../cc/core/Mat.cc:1:
/home/ubuntu/.node-gyp/10.14.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8:
:WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]’:
/home/ubuntu/.node-gyp/10.14.0/include/node/node_object_wrap.h:85:78: required from here
/home/ubuntu/.node-gyp/10.14.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo::Call
back’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
9502 | reinterpret_cast(callback), type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/.node-gyp/10.14.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8:
:WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]’:
../node_modules/nan/nan_object_wrap.h:65:61: required from here
/home/ubuntu/.node-gyp/10.14.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo::Callb
ack’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: *** [Release/obj.target/opencv4nodejs/cc/core/Mat.o] Error 1
make: Leaving directory `/usr/lib/node_modules/opencv4nodejs/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
```

*OpenCV version* (example 3.4.1): 3.4.7

*With OpenCV-contrib?* (extra modules): no

At least I don't think so, this is the command I used to configure the opencv build:

```
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_PRECOMPILED_HEADERS=OFF -D CMAKE_INSTALL_PREFIX=/usr/local ..
```

*OS*: Windows 7 / 8 / 10? / MacOSX? / Ubuntu? Ubuntu 14.04

I initially tried with a much older gcc, and the compilation failed on a different step. I think installed the more or less latest gcc (9.1) and recompiled opencv with this. opencv4nodejs compilation then failed with the error message above on Mat.o.

Is there a certain version of gcc I should have installed? Should I use another compiler and if so how do I set the env vars correctly to configure that? I couldn't actually find an error message that wasn't a warning besides `g++: fatal error: Killed signal terminated program cc1plus`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.