Git Product home page Git Product logo

Comments (8)

lebenasa avatar lebenasa commented on September 27, 2024

I also got same error using Emscripten 1.37.16 and OpenCV 3.1.0, using master branch of opencvjs. After opening bind.h, I found that the template base only accepts single argument indeed. When I removed the boolean value in bindings.cpp, I got this error instead:

In file included from ../../bindings.cpp:47:
/home/leben/Labs/emsdk-portable/emscripten/1.37.16/system/include/emscripten/bind.h:1065:20: error: cannot cast 'cv::Algorithm *' to 'cv::Feature2D *' via virtual base 'cv::Algorithm'
            return static_cast<To*>(ptr);
                   ^~~~~~~~~~~~~~~~~~~~~
/home/leben/Labs/emsdk-portable/emscripten/1.37.16/system/include/emscripten/bind.h:1060:21: note: in instantiation of function template specialization
      'emscripten::base<cv::Algorithm>::convertPointer<cv::Algorithm, cv::Feature2D>' requested here
            return &convertPointer<BaseClass, ClassType>;
                    ^
/home/leben/Labs/emsdk-portable/emscripten/1.37.16/system/include/emscripten/bind.h:1125:53: note: in instantiation of function template specialization
      'emscripten::base<cv::Algorithm>::getDowncaster<cv::Feature2D>' requested here
            auto downcast = BaseSpecifier::template getDowncaster<ClassType>();
                                                    ^
../../bindings.cpp:3271:5: note: in instantiation of member function 'emscripten::class_<cv::Feature2D, emscripten::base<cv::Algorithm> >::class_' requested here
    emscripten::class_<cv::Feature2D ,base<Algorithm>>("Feature2D")
    ^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
Traceback (most recent call last):
  File "make.py", line 183, in <module>
    emscripten.Building.emcc('../../bindings.cpp', emcc_binding_args, 'bindings.bc')
  File "/home/leben/Labs/emsdk-portable/emscripten/1.37.16/tools/shared.py", line 1996, in emcc
    assert os.path.exists(output_filename), 'emcc could not create output file: ' + output_filename
AssertionError: emcc could not create output file: bindings.bc

Still trying to figure it out. Any help would be appreciated.

from opencvjs.

drhouse82 avatar drhouse82 commented on September 27, 2024

Same problem here... Any suggestions?

from opencvjs.

drhouse82 avatar drhouse82 commented on September 27, 2024

It turns this is due to non-successful application of the emscripten patch delivered within this repository.

Working on windows, I moreover had to disable multiprocessing and modify class FakeMultiprocessor (to support map_async) in emscripten\incoming\tools\shared.py for reasons I do not understand. Finally it worked out.

from opencvjs.

justadudewhohacks avatar justadudewhohacks commented on September 27, 2024

I applied the emscripten patch but still run into this issue.

from opencvjs.

drhouse82 avatar drhouse82 commented on September 27, 2024

Do you have the issue of the first or the second post? The issue of the first post should be fixed by the patch. The issue of the second post only appears if you modify bindings.cpp erroneously.

from opencvjs.

justadudewhohacks avatar justadudewhohacks commented on September 27, 2024

Sorry, I am referring to the error caused by the inner template argument in feature2d. I applied the patch and rebuild emsdk as suggested. Do I have to modify the bindings to get it running?

from opencvjs.

drhouse82 avatar drhouse82 commented on September 27, 2024

I'm not an expert in this, but I believe the patch didn't work.
The error you get complains about too many template arguments of base template.
The patch changes the number of arguments of the base template to 2, so it should then work.

Have a look inside the diff file, it's quite obvious.
I did actually not manage to apply the patch (on Windows) and made the changes listed inside the diff file manually, instead.

from opencvjs.

juicycool92 avatar juicycool92 commented on September 27, 2024

@drhouse82
Hello there, im new of this, and have same error on windows.
seems like your reply is only answer who make successfuly on window in this project.
but sadly, im newbie at programming, therefore i cannot understand what is ovbious, what line do i edit or else.
Please, can you describe little more detail?
this will help me and other people who trying to use this project in future.
cause no one give answer actually working so far guess..

Thanks.

from opencvjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.