Giter Club home page Giter Club logo

Comments (5)

traversaro avatar traversaro commented on May 30, 2024 1

Hi @carlfm01 ,
as far as I know, there is no Bazel BUILD file available for dlfcn-win32.
However, the library is quite simple (it is just composed of the dlfcn.h header file and
the dlfcn.c source file. There are a few more details (you need to define the SHARED macro
if you are building it as a shared library, and you need to link the psapi library) but it should be fairly simple to compile in any build system, and bazel
has some nice docs on how to build C++ projects: https://docs.bazel.build/versions/master/tutorial/cpp.html and https://github.com/bazelbuild/examples/tree/master/cpp-tutorial .

As the library is relatively simple, it is not a problem to maintain several build systems upstream, so if you want to work on Bazel support I will be happy to review a PR.

from dlfcn-win32.

carlfm01 avatar carlfm01 commented on May 30, 2024 1

Thanks, really appreciate that you take the time to reply, I'll look into that. My final goal with this is to finally bring a DeepSpeech client to Windows. I'll share the results.

from dlfcn-win32.

traversaro avatar traversaro commented on May 30, 2024 1

For people interested in Bazel support, the rules_foreign_cc may be interesting.

from dlfcn-win32.

carlfm01 avatar carlfm01 commented on May 30, 2024

Hi, I finally compiled it using this BUILD file for Bazel

cc_library(
name = "dlfnwin",
srcs = ["dlfcn.c"],
hdrs = ["dlfcn.h"],
linkopts = ["-DEFAULTLIB:psapi.lib"],

)

cc_library(
name = "testdl",
srcs = ["testdll.c"],
deps = [
":dlfnwin",
],

)

cc_binary(
name = "test",
srcs = ["test.c"],
deps = [
":testdl",
],

)

The problem is when I run the .exe the file the lib didn't load.

I found https://github.com/kkm000/openfst for my project. When I finish my project I'll try again.

from dlfcn-win32.

traversaro avatar traversaro commented on May 30, 2024

I am not a bazel user, but I have two doubts:

  • Are you sure that cc_library for testdll.c is generating a shared library with the correct name testdll.dll ? The test hardcoded that that is the expected name of the plugin to load:
    library = dlopen( "testdll.dll", RTLD_GLOBAL );
    .
  • Are you running the test executable in the same directory that contains the testdll.dll file? Again, that is something that is hardcoded in the test.

from dlfcn-win32.

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.