#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

  1. Clone the libadblockplus repository
  2. Follow the build instructions and build the solution for Windows
  3. Create new CLR project and add libadblockplus library as reference
  4. 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

Change History (3)

comment:1 Changed 23 months ago by hfiguiere

  • Component changed from Unknown to Libadblockplus

comment:2 Changed 22 months ago by oleksandr

  • Cc sergz oleksandr added

I think based on our email communication this has been resolved. I'll let Sergei decide what to do with this ticket.

comment:3 Changed 22 months ago 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.

Note: See TracTickets for help on using tickets.