cair / deep-rts

A Real-Time-Strategy game for Deep Learning research
MIT License
202 stars 34 forks source link

which opencv version to use? #25

Open khcf123 opened 2 years ago

khcf123 commented 2 years ago

I am currently using opencv version 4.5.4 to compile this project. It turns out giving me these errors:

ndarray_converter.obj : error LNK2001: unresolved external symbol "public: void cdecl cv::Mat::copyTo(class cv::debug_build_guard::_OutputArray const &)const " (?copyTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@@Z) [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj] Blend2DGUI.obj : error LNK2001: unresolved external symbol "public: class cv::Mat & cdecl cv::Mat::setTo(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &)" (?setTo@Mat@cv@@QEAAAEAV12@AEBV_InputArray@debug_build_guard@2@0@Z) [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj] Blend2DGUI.obj : error LNK2001: unresolved external symbol "bool __cdecl cv::imencode(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class cv::debug_build_guard::_InputArray const &,class std::vector<unsigned char,class std::allocator > &,class std::vector<int,class std::allocator > const &)" (?imencode@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEAV?$vector@EV?$allocator@E@std@@@3@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj] Blend2DGUI.obj : error LNK2001: unresolved external symbol "class cv::Mat cdecl cv::imdecode(class cv::debug_build_guard::_InputArray const &,int)" (?imdecode@cv@@YA?AVMat@1@AEBV_InputArray@debug_build_guard@1@H@Z) [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj] Blend2DGUI.obj : error LNK2001: unresolved external symbol "void cdecl cv::inRange(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &)" (?inRange@cv@@YAXAEBV_InputArray@debug_build_guard@1@00AEBV_OutputArray@31@@Z) [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj] C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\lib.win-amd64-3.10\DeepRTS\Engine.cp310-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals [C:\Users\alexa\AppData\Local\Temp\pip-req-build-z8212hxv\build\temp.win-amd64-3.10\Release\Engine.vcxproj]

What to do to solve these issues? Thanks!!

perara commented 2 years ago

Hi there! I've have just kept to the latest one, but I can see that I've commented out the OpenCV installation through pmm so the linking might bug out on Windows. If you remove the comment on OpenCV in CMakeLists.txt#L88 that might solve this issue.

If this does not help, I suppose the linking is not working properly on windows..

It should also be noted that I have not gotten the time to ensure that this compiles on Windows as I currently only have Linux environments, but I hope to be able to do a roundup on adding Windows (and IOS) support later next year (sorry!).

khcf123 commented 2 years ago

I already remove the comment on OpenCV in CMakeLists.txt#L88, but still cannot solve this issue. I am compiling on windows 10.

Anymore advice, thanks!!