Opened on 11/06/2017 at 12:45:01 PM
Closed on 11/18/2017 at 02:35:03 PM
#5995 closed defect (worksforme)
libadblockplus is not CLR compatible
Reported by: | vtyutin | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Libadblockplus | Keywords: | |
Cc: | sergz, oleksandr | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Environment
Windows 10 (x64)
VisualStudio 2017
How to reproduce
- Clone the libadblockplus repository
- Follow the build instructions and build the solution for Windows
- Create new CLR project and add libadblockplus library as reference
- Try to build
Observed behaviour
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\include\mutex(8): fatal error C1189: #error: <mutex> is not supported when compiling with /clr or /clr:pure.
Expected behaviour
I need to build CLR library with libadblockplus to use it in C# project
Attachments (0)
Change History (3)
comment:1 Changed on 11/07/2017 at 02:41:51 PM by hfiguiere
- Component changed from Unknown to Libadblockplus
comment:2 Changed on 11/18/2017 at 06:02:52 AM by oleksandr
- Cc sergz oleksandr added
comment:3 Changed on 11/18/2017 at 02:35:03 PM by sergz
- Resolution set to worksforme
- Status changed from new to closed
I would like to put a short description of the ways to achieve the goal, so anyone can find it later. However, the problem of using the library in other environments is still here.
The bullet-proof approach would be to wrap libadblockplus into C API, but I guess it's not a real option because of a lot of work. The second approach, which also requires some efforts but less, is to create a C++/CLI wrapper (DLL) around libadblockplus. As I understand with this approach there are compilation errors because of <mutex> and probably some other headers and classes. For present I can propose to remove these headers and classes at least from JsEngine.h and Platform.h.
In addition there is already a similar approach for Java (https://github.com/adblockplus/libadblockplus-android/tree/master/libadblockplus-android/jni, https://github.com/adblockplus/libadblockplus-android/tree/master/libadblockplus-android/src/org/adblockplus/libadblockplus/), though it's not close to a generic code which can be easily re-used for CLR.
All in all, right now there is no an easy way of doing it but we are aware about the problem and will keep it mind.
I think based on our email communication this has been resolved. I'll let Sergei decide what to do with this ticket.