opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

Error when building

Open notsapinho opened this issue 2 years ago • 15 comments

Keep getting this error when running "npx build-opencv --nobuild rebuild"

Creating library D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.lib and object D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.exp
imgproc.obj : error LNK2001: unresolved external symbol "class cv::Matx<double,2,3> __cdecl cv::getRotationMatrix2D_(class cv::Point_<float>,double,double)" (?getRotationMatrix2D_@cv@@YA?AV?$Matx@N$01$02@1@V?$Point_@M@1@NN@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
VideoCapture.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,class std::vector<int,class std::allocator<int> > const &)" (?open@VideoCapture@cv@@UEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HAEBV?$vector@HV?$allocator@H@std@@@4@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
VideoCapture.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::open(int,int,class std::vector<int,class std::allocator<int> > const &)" (?open@VideoCapture@cv@@UEAA_NHHAEBV?$vector@HV?$allocator@H@std@@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNet(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNet@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::Mat __cdecl cv::dnn::dnn4_v20220524::blobFromImages(class cv::_InputArray const &,double,class cv::Size_<int>,class cv::Scalar_<double> const &,bool,bool,int)" (?blobFromImages@dnn4_v20220524@dnn@cv@@YA?AVMat@3@AEBV_InputArray@3@NV?$Size_@H@3@AEBV?$Scalar_@N@3@_N3H@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromTensorflow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromTensorflow@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: bool __cdecl cv::dnn::dnn4_v20220524::Net::empty(void)const " (?empty@Net@dnn4_v20220524@dnn@cv@@QEBA_NXZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::dnn::dnn4_v20220524::Net::~Net(void)" (??1Net@dnn4_v20220524@dnn@cv@@QEAA@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::dnn::dnn4_v20220524::Net::Net(void)" (??0Net@dnn4_v20220524@dnn@cv@@QEAA@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromONNX(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromONNX@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "void __cdecl cv::dnn::dnn4_v20220524::NMSBoxes(class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > const &,class std::vector<float,class std::allocator<float> > const &,float,float,class std::vector<int,class std::allocator<int> > &,float,int)" (?NMSBoxes@dnn4_v20220524@dnn@cv@@YAXAEBV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@AEBV?$vector@MV?$allocator@M@std@@@5@MMAEAV?$vector@HV?$allocator@H@std@@@5@MH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromDarknet(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromDarknet@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::Mat __cdecl cv::dnn::dnn4_v20220524::blobFromImage(class cv::_InputArray const &,double,class cv::Size_<int> const &,class cv::Scalar_<double> const &,bool,bool,int)" (?blobFromImage@dnn4_v20220524@dnn@cv@@YA?AVMat@3@AEBV_InputArray@3@NAEBV?$Size_@H@3@AEBV?$Scalar_@N@3@_N3H@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromCaffe(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromCaffe@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: __int64 __cdecl cv::dnn::dnn4_v20220524::Net::getPerfProfile(class std::vector<double,class std::allocator<double> > &)" (?getPerfProfile@Net@dnn4_v20220524@dnn@cv@@QEAA_JAEAV?$vector@NV?$allocator@N@std@@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::vector<int,class std::allocator<int> > __cdecl cv::dnn::dnn4_v20220524::Net::getUnconnectedOutLayers(void)const " (?getUnconnectedOutLayers@Net@dnn4_v20220524@dnn@cv@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setInput(class cv::_InputArray const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double,class cv::Scalar_<double> const &)" (?setInput@Net@dnn4_v20220524@dnn@cv@@QEAAXAEBV_InputArray@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@NAEBV?$Scalar_@N@4@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setPreferableTarget(int)" (?setPreferableTarget@Net@dnn4_v20220524@dnn@cv@@QEAAXH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setPreferableBackend(int)" (?setPreferableBackend@Net@dnn4_v20220524@dnn@cv@@QEAAXH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class cv::Mat __cdecl cv::dnn::dnn4_v20220524::Net::forward(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?forward@Net@dnn4_v20220524@dnn@cv@@QEAA?AVMat@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::forward(class cv::_OutputArray const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (?forward@Net@dnn4_v20220524@dnn@cv@@QEAAXAEBV_OutputArray@4@AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl cv::dnn::dnn4_v20220524::Net::getLayerNames(void)const " (?getLayerNames@Net@dnn4_v20220524@dnn@cv@@QEBA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl cv::dnn::dnn4_v20220524::Net::dump(void)" (?dump@Net@dnn4_v20220524@dnn@cv@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.node : fatal error LNK1120: 23 unresolved externals [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Random\TinderAI\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Random\\TinderAI\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" "--release"
gyp ERR! cwd D:\Random\TinderAI\node_modules\@u4\opencv4nodejs
gyp ERR! node -v v18.14.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
error:  Error: Command failed: node-gyp rebuild --jobs max --release
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.9.12 found at "C:\Program Files\Python39\python.exe"
gyp info find VS using VS2017 (15.9.33403.129) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Program Files\Python39\python.exe
gyp info spawn args [
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Random\\TinderAI\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\notsapinho\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.14.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64',
gyp info spawn args   '/m:20'
gyp info spawn args ]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Random\TinderAI\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Random\\TinderAI\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" "--release"
gyp ERR! cwd D:\Random\TinderAI\node_modules\@u4\opencv4nodejs
gyp ERR! node -v v18.14.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok

notsapinho avatar Mar 12 '23 00:03 notsapinho

You use the --nobuild arg but you openCV prebuilt version do not contains all the expected features.

let build-opencv build openCV from source, or use a different openCV binary.

UrielCh avatar Mar 12 '23 12:03 UrielCh

I have downloaded opencv from chocolatey, but when I start the application it shows this

                throw Error(`No build found in ${this.rootDir} you should launch opencv-build-npm once`);
                ^

Error: No build found in D:\Random\TinderAI\node_modules\@u4\opencv-build\dist you should launch opencv-build-npm once
    at OpenCVBuildEnv (D:\Random\TinderAI\node_modules\@u4\opencv-build\src\OpenCVBuildEnv.ts:317:23)
    at OpenCVBuilder (D:\Random\TinderAI\node_modules\@u4\opencv-build\src\OpenCVBuilder.ts:28:18)
    at getOpenCV (D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\lib\cvloader.js:38:21)
    at loadOpenCV (D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\lib\opencv4nodejs.js:6:48)
    at Object.<anonymous> (D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\lib\opencv4nodejs.js:21:12)
    at Module._compile (node:internal/modules/cjs/loader:1226:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
    at Module.load (node:internal/modules/cjs/loader:1089:32)
    at Module._load (node:internal/modules/cjs/loader:930:12)
    at Module.require (node:internal/modules/cjs/loader:1113:19)

notsapinho avatar Mar 12 '23 12:03 notsapinho

Check the github action

UrielCh avatar Mar 12 '23 13:03 UrielCh

kinda lost ngl

notsapinho avatar Mar 12 '23 13:03 notsapinho

Did the same steps as in the github action and Im still getting

     Creating library D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.lib and object D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.exp
imgproc.obj : error LNK2001: unresolved external symbol "class cv::Matx<double,2,3> __cdecl cv::getRotationMatrix2D_(class cv::Point_<float>,double,double)" (?getRotationMatrix2D_@cv@@YA?AV?$Matx@N$01$02@1@V?$Point_@M@1@NN@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
VideoCapture.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,class std::vector<int,class std::allocator<int> > const &)" (?open@VideoCapture@cv@@UEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HAEBV?$vector@HV?$allocator@H@std@@@4@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
VideoCapture.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::open(int,int,class std::vector<int,class std::allocator<int> > const &)" (?open@VideoCapture@cv@@UEAA_NHHAEBV?$vector@HV?$allocator@H@std@@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNet(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNet@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::Mat __cdecl cv::dnn::dnn4_v20220524::blobFromImages(class cv::_InputArray const &,double,class cv::Size_<int>,class cv::Scalar_<double> const &,bool,bool,int)" (?blobFromImages@dnn4_v20220524@dnn@cv@@YA?AVMat@3@AEBV_InputArray@3@NV?$Size_@H@3@AEBV?$Scalar_@N@3@_N3H@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromTensorflow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromTensorflow@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: bool __cdecl cv::dnn::dnn4_v20220524::Net::empty(void)const " (?empty@Net@dnn4_v20220524@dnn@cv@@QEBA_NXZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::dnn::dnn4_v20220524::Net::~Net(void)" (??1Net@dnn4_v20220524@dnn@cv@@QEAA@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::dnn::dnn4_v20220524::Net::Net(void)" (??0Net@dnn4_v20220524@dnn@cv@@QEAA@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromONNX(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromONNX@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "void __cdecl cv::dnn::dnn4_v20220524::NMSBoxes(class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > const &,class std::vector<float,class std::allocator<float> > const &,float,float,class std::vector<int,class std::allocator<int> > &,float,int)" (?NMSBoxes@dnn4_v20220524@dnn@cv@@YAXAEBV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@AEBV?$vector@MV?$allocator@M@std@@@5@MMAEAV?$vector@HV?$allocator@H@std@@@5@MH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromDarknet(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromDarknet@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::Mat __cdecl cv::dnn::dnn4_v20220524::blobFromImage(class cv::_InputArray const &,double,class cv::Size_<int> const &,class cv::Scalar_<double> const &,bool,bool,int)" (?blobFromImage@dnn4_v20220524@dnn@cv@@YA?AVMat@3@AEBV_InputArray@3@NAEBV?$Size_@H@3@AEBV?$Scalar_@N@3@_N3H@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
dnn.obj : error LNK2001: unresolved external symbol "class cv::dnn::dnn4_v20220524::Net __cdecl cv::dnn::dnn4_v20220524::readNetFromCaffe(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNetFromCaffe@dnn4_v20220524@dnn@cv@@YA?AVNet@123@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: __int64 __cdecl cv::dnn::dnn4_v20220524::Net::getPerfProfile(class std::vector<double,class std::allocator<double> > &)" (?getPerfProfile@Net@dnn4_v20220524@dnn@cv@@QEAA_JAEAV?$vector@NV?$allocator@N@std@@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::vector<int,class std::allocator<int> > __cdecl cv::dnn::dnn4_v20220524::Net::getUnconnectedOutLayers(void)const " (?getUnconnectedOutLayers@Net@dnn4_v20220524@dnn@cv@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setInput(class cv::_InputArray const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double,class cv::Scalar_<double> const &)" (?setInput@Net@dnn4_v20220524@dnn@cv@@QEAAXAEBV_InputArray@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@NAEBV?$Scalar_@N@4@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setPreferableTarget(int)" (?setPreferableTarget@Net@dnn4_v20220524@dnn@cv@@QEAAXH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::setPreferableBackend(int)" (?setPreferableBackend@Net@dnn4_v20220524@dnn@cv@@QEAAXH@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class cv::Mat __cdecl cv::dnn::dnn4_v20220524::Net::forward(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?forward@Net@dnn4_v20220524@dnn@cv@@QEAA?AVMat@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::dnn::dnn4_v20220524::Net::forward(class cv::_OutputArray const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (?forward@Net@dnn4_v20220524@dnn@cv@@QEAAXAEBV_OutputArray@4@AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl cv::dnn::dnn4_v20220524::Net::getLayerNames(void)const " (?getLayerNames@Net@dnn4_v20220524@dnn@cv@@QEBA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
Net.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl cv::dnn::dnn4_v20220524::Net::dump(void)" (?dump@Net@dnn4_v20220524@dnn@cv@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs.node : fatal error LNK1120: 23 unresolved externals [D:\Random\TinderAI\node_modules\@u4\opencv4nodejs\build\opencv4nodejs.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Random\TinderAI\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Random\\TinderAI\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" "--release"
gyp ERR! cwd D:\Random\TinderAI\node_modules\@u4\opencv4nodejs
gyp ERR! node -v v18.14.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
error:  Error: Command failed: D:\Random\TinderAI\node_modules\.bin\node-gyp rebuild --jobs max --release
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.9.12 found at "C:\Program Files\Python39\python.exe"
gyp info find VS using VS2019 (16.11.33328.57) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Program Files\Python39\python.exe
gyp info spawn args [
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Random\\TinderAI\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\notsapinho\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.14.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64',
gyp info spawn args   '/m:20'
gyp info spawn args ]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Random\TinderAI\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Random\\TinderAI\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" "--release"
gyp ERR! cwd D:\Random\TinderAI\node_modules\@u4\opencv4nodejs
gyp ERR! node -v v18.14.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok

    at ChildProcess.exithandler (node:child_process:419:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'D:\\Random\\TinderAI\\node_modules\\.bin\\node-gyp rebuild --jobs max --release '
}
ERR! install node-gyp failed and return Error Command failed: D:\Random\TinderAI\node_modules\.bin\node-gyp rebuild --jobs max --release
ERR! install gyp info it worked if it ends with ok
ERR! install gyp info using [email protected]
ERR! install gyp info using [email protected] | win32 | x64
ERR! install gyp info find Python using Python version 3.9.12 found at "C:\Program Files\Python39\python.exe"
ERR! install gyp info find VS using VS2019 (16.11.33328.57) found at:
ERR! install gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
ERR! install gyp info find VS run with --verbose for detailed information
ERR! install gyp info spawn C:\Program Files\Python39\python.exe
ERR! install gyp info spawn args [
ERR! install gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\gyp\\gyp_main.py',
ERR! install gyp info spawn args   'binding.gyp',
ERR! install gyp info spawn args   '-f',
ERR! install gyp info spawn args   'msvs',
ERR! install gyp info spawn args   '-I',
ERR! install gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build\\config.gypi',
ERR! install gyp info spawn args   '-I',
ERR! install gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\node-gyp\\addon.gypi',
ERR! install gyp info spawn args   '-I',
ERR! install gyp info spawn args   'C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0\\include\\node\\common.gypi',
ERR! install gyp info spawn args   '-Dlibrary=shared_library',
ERR! install gyp info spawn args   '-Dvisibility=default',
ERR! install gyp info spawn args   '-Dnode_root_dir=C:\\Users\\notsapinho\\AppData\\Local\\node-gyp\\Cache\\18.14.0',
ERR! install gyp info spawn args   '-Dnode_gyp_dir=D:\\Random\\TinderAI\\node_modules\\node-gyp',
ERR! install gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\notsapinho\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.14.0\\\\<(target_arch)\\\\node.lib',
ERR! install gyp info spawn args   '-Dmodule_root_dir=D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs',
ERR! install gyp info spawn args   '-Dnode_engine=v8',
ERR! install gyp info spawn args   '--depth=.',
ERR! install gyp info spawn args   '--no-parallel',
ERR! install gyp info spawn args   '--generator-output',
ERR! install gyp info spawn args   'D:\\Random\\TinderAI\\node_modules\\@u4\\opencv4nodejs\\build',
ERR! install gyp info spawn args   '-Goutput_dir=.'
ERR! install gyp info spawn args ]
ERR! install gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
ERR! install gyp info spawn args [
ERR! install gyp info spawn args   'build/binding.sln',
ERR! install gyp info spawn args   '/clp:Verbosity=minimal',
ERR! install gyp info spawn args   '/nologo',
ERR! install gyp info spawn args   '/p:Configuration=Release;Platform=x64',
ERR! install gyp info spawn args   '/m:20'
ERR! install gyp info spawn args ]
ERR! install gyp ERR! build error
ERR! install gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
ERR! install gyp ERR! stack     at ChildProcess.onExit (D:\Random\TinderAI\node_modules\node-gyp\lib\build.js:203:23)
ERR! install gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
ERR! install gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
ERR! install gyp ERR! System Windows_NT 10.0.19045
ERR! install gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Random\\TinderAI\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" "--release"
ERR! install gyp ERR! cwd D:\Random\TinderAI\node_modules\@u4\opencv4nodejs
ERR! install gyp ERR! node -v v18.14.0
ERR! install gyp ERR! node-gyp -v v9.3.1
ERR! install gyp ERR! not ok
ERR! install  return code: 1

notsapinho avatar Mar 12 '23 14:03 notsapinho

So try the auto-build feature; I'm a bit busy today.

UrielCh avatar Mar 12 '23 14:03 UrielCh

what do you mean by auto-build?

notsapinho avatar Mar 12 '23 15:03 notsapinho

Hi , @UrielCh

.webpack you should launch opencv-build-npm once

the same error to me

but when I run it work normally just when I package it and open app , the error occur

here is my code repository https://github.com/jacobdong/opencv_starter

npm start

img

npm package img_1

jacobdong avatar Mar 12 '23 15:03 jacobdong

when I auto build the different error below

└─(23:54:11 on main ✹)──> npm start                                                                                                                                                                                                     ──(Sun,Mar12)─┘

> [email protected] start
> electron-forge start

✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies: 2 / 2 [3m24s]
✔ Running generateAssets hook
✔ [plugin-webpack] Compiling main process code [1s]
✔ [plugin-webpack] Launching dev servers for renderer process code [0.5s]
  › Output Available: http://localhost:9000

info config no opencv4nodejs section found in /Users/jacob/__code/__lab/__electron/opencv_starter/package.json
App threw an error during load
Error: dlopen(/Users/jacob/__code/__lab/__electron/opencv_starter/.webpack/main/native_modules/build/Release/opencv4nodejs.node, 0x0001): symbol not found in flat namespace '__ZNK2cv12MatAllocator23getBufferPoolControllerEPKc'
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822)
    at Module.load (node:internal/modules/cjs/loader:1044:32)
    at Module._load (node:internal/modules/cjs/loader:885:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1068:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at ./node_modules/@u4/opencv4nodejs/build/Release/opencv4nodejs.node (/Users/jacob/__code/__lab/__electron/opencv_starter/.webpack/main/index.js:8237:18)
    at __webpack_require__ (/Users/jacob/__code/__lab/__electron/opencv_starter/.webpack/main/index.js:26937:42)

jacobdong avatar Mar 12 '23 15:03 jacobdong

Check the electron sample, electron use a different build system.

UrielCh avatar Mar 12 '23 16:03 UrielCh

thank U, I know it I have been saw your others project

https://github.com/UrielCh/opencv-electron

and I build it in same way

"scripts": { "start": "electron-forge start", "rebuild": "build-opencv --electron --version 4.6.0 build", "package": "electron-forge package", "make": "electron-forge make", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx ." }

I've been confused for several days at the same time, I use the official recommand build electron-forge init the project and just bind one function show opencv version without other. when you are free, you can download it I sincerely hope to get your help

https://github.com/jacobdong/opencv_starter

jacobdong avatar Mar 12 '23 16:03 jacobdong

The next version is currently in its sandbox phase: https://github.com/UrielCh/opencv-sandbox

It will be published into https://github.com/opencv/opencv if I have time to complete it, @piercus helping me to complete this version. but our general C++ level is pretty low 😿

UrielCh avatar Mar 19 '23 12:03 UrielCh

hello @UrielCh

issue: webpack you should launch opencv-build-npm once

I spent a lot of time reading the source code of the project and found the issue webpack you should launch opencv-build-npm once This problem occurs because theOPENCV4NODEJS_DISABLE_AUTOBUILD system environment variable is not read by the app after the electron project is packaged. Therefore, I made a special treatment before importing opencv4nodejs:

const env = process.env; 
env.OPENCV4NODEJS_DISABLE_AUTOBUILD = "1"
import opencv from '@u4/opencv4nodejs'. 

The packaged app can now be launched correctly on my local machine.

issue: lib/libopencv_core.407.dylib' (no such file)

However, when I shared the app with other colleagues, an error occurred that showed the path I used when packaging the app:

Uncaught Exception:
Error: dlopen(/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/native_modules/build/Release/opencv4nodejs.node, 0x0001): Library not loaded: '@rpath/libopencv_core.407.dylib'
Referenced from: '/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/native_modules/build/Release/opencv4nodejs.node'
Reason: tried: '/Users/dongfapeng/__build/opencv/opencv-4.7.0-09efe/build/lib/libopencv_core.407.dylib' (no such file), '/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/native_modules/build/Release/../../../opencv-build/opencv/build/lib/libopencv_core.407.dylib' (no such file), '/Users/dongfapeng/__build/opencv/opencv-4.7.0-09efe/build/lib/libopencv_core.407.dylib' (no such file), '/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/native_modules/build/Release/../../../opencv-build/opencv/build/lib/libopencv_core.407.dylib' (no such file), '/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libopencv_core.407.dylib' (no such file), '/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/MacOS/../Frameworks/libopencv_core.407.dylib' (no such file), '/usr/local/lib/libopencv_core.407.dylib' (no such file), '/usr/lib/libopencv_core.407.dylib' (no such file)
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822)
at Module.load (node:internal/modules/cjs/loader:1044:32)
at Module._load (node:internal/modules/cjs/loader:885:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1068:19)
at require (node:internal/modules/cjs/helpers:103:18)
at 6227 (/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/index.js:1:39)
at n (/private/var/folders/7h/bl17c3910zg9w421rj1nq4nm0000gn/T/AppTranslocation/041DAB17-88CE-4ECB-810D-00000C56BF86/d/opencv_starter.app/Contents/Resources/app/.webpack/main/index.js:1:222100)

jacobdong avatar Apr 29 '23 10:04 jacobdong

Can you give me more context? or open a PR?

UrielCh avatar Apr 29 '23 16:04 UrielCh

here is a very simple project for electron with opencv4nodejs

https://github.com/jacobdong/electron_opencv

it just show opencv version info when you pnpm package to app and share it to others you will get the error

jacobdong avatar May 04 '23 04:05 jacobdong