Coder Social home page Coder Social logo

Comments (8)

metadings avatar metadings commented on July 23, 2024

You should set the files in i386/amd64 to "copy if newer", so you end up with

bin\Debug\YourProject.exe
bin\Debug\ZeroMQ.dll
bin\Debug\i386\libzmq.so
bin\Debug\i386\libzmq.dll
bin\Debug\i386\libsodium.so
bin\Debug\i386\libsodium.dll
bin\Debug\amd64\libzmq.so
bin\Debug\amd64\libzmq.dll
bin\Debug\amd64\libsodium.so
bin\Debug\amd64\libsodium.dll

The Platform.LoadUnmanagedLibrary looks first into the folders i386/amd64.

from clrzmq4.

tomwinans avatar tomwinans commented on July 23, 2024

Hi

When I use the nuget package on linux I get the following exception. For some reason it is looking in /var for the .so file. I am using this on OSX with Mono and find the same problem, though "copy if newer" and "always copy" do not resolve. Here is what I get when I put the lib...{dll&so} in the folder named here:

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.IO.FileNotFoundException: UnmanagedLibrary[libzmq] Unable to load library "libzmq" from "/var/folders/jm/vkm98mmn2pq6gj6ysc3b3xwm0000gn/T/libzmq.so". Inspect Trace output for details.
File name: '/var/folders/jm/vkm98mmn2pq6gj6ysc3b3xwm0000gn/T/libzmq.so' ---> System.DllNotFoundException: dlopen(/var/folders/jm/vkm98mmn2pq6gj6ysc3b3xwm0000gn/T/libzmq.so, 257): no suitable image found. Did find:
/var/folders/jm/vkm98mmn2pq6gj6ysc3b3xwm0000gn/T/libzmq.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00
at ZeroMQ.lib.Platform+Posix.LoadUnmanagedLibrary (System.String libraryName) [0x00213] in /Users/tommy/Downloads/clrzmq4-master/lib/Platform.Posix.cs:123
at ZeroMQ.lib.zmq..cctor () [0x005b6] in /Users/tommy/Downloads/clrzmq4-master/lib/zmq.cs:40
--- End of inner exception stack trace ---
at ZeroMQ.ZContext..ctor () [0x00007] in /Users/tommy/Downloads/clrzmq4-master/ZContext.cs:55
at Examples.Program.Main (System.String[] args) [0x00008] in /Users/tommy/Projects/ZMQ_Example/ZMQ_Example/Program.cs:170

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

YES...

I was installing Linux Mint on my computer, and I noticed there is no more a libc.so... There was just a /lib/x86_64-linux-gnu/libdl.so.2...

I resolved it currently by making a hardlink

ln /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so

Now look, you're using OSX? You may need dylib files... However I don't have OSX

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

On MacOSX this should override using ZeroMQ.lib.Platform.MacOSX instead of ZeroMQ.lib.Platform.Posix ...

How would you resolve your platform is MacOSX?

I'm currently doing so in ZeroMQ.lib.Platform.cs:

switch (Environment.OSVersion.Platform) {
    // ...
case PlatformID.MacOSX:
    Kind = PlatformKind.Posix;
    Name = PlatformName.MacOSX;

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

Look: I had the idea of adding these lines to lib/Platform.cs...

You need a git pull zeromq master or git clone https://github.com/zeromq/clrzmq4 ZeroMQ ...
and rebuild the package to try

IsMonoMac = assemblies.Any(a => a.GetName().Name.Equals("MonoMac", StringComparison.InvariantCultureIgnoreCa

if (IsMonoMac) {
    Kind = PlatformKind.Posix;
    Name = PlatformName.MacOSX;
}

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

On Linux and also for MacOSX systems, I've updated the code to properly load files from, for example

[0]: "/home/metadings/zguide/examples/C#/bin/Debug/amd64/libsodium.so.*"
[1]: "/home/metadings/zguide/examples/C#/bin/Debug/x64/libsodium.so.*"
[2]: "/home/metadings/zguide/examples/C#/bin/Debug/amd64/libsodium.so"
[3]: "/home/metadings/zguide/examples/C#/bin/Debug/x64/libsodium.so"
[4]: "/usr/lib/x86_64-linux-gnu/libfakeroot/libsodium.so.*"
[5]: "/usr/lib/i386-linux-gnu/mesa/libsodium.so.*"
[6]: "/lib/i386-linux-gnu/libsodium.so.*"
[7]: "/usr/lib/i386-linux-gnu/libsodium.so.*"
[8]: "/usr/local/lib/libsodium.so.*"
[9]: "/lib/x86_64-linux-gnu/libsodium.so.*"
[10]: "/usr/lib/x86_64-linux-gnu/libsodium.so.*"
[11]: "/usr/lib/x86_64-linux-gnu/mesa-egl/libsodium.so.*"
[12]: "/usr/lib/x86_64-linux-gnu/mesa/libsodium.so.*"
[13]: "/usr/lib/x86_64-linux-gnu/libfakeroot/libsodium.so"
[14]: "/usr/lib/i386-linux-gnu/mesa/libsodium.so"
[15]: "/lib/i386-linux-gnu/libsodium.so"
[16]: "/usr/lib/i386-linux-gnu/libsodium.so"
[17]: "/usr/local/lib/libsodium.so"
[18]: "/lib/x86_64-linux-gnu/libsodium.so"
[19]: "/usr/lib/x86_64-linux-gnu/libsodium.so"
[20]: "/usr/lib/x86_64-linux-gnu/mesa-egl/libsodium.so"
[21]: "/usr/lib/x86_64-linux-gnu/mesa/libsodium.so"

Please do a git pull zeromq master to try the changes.

I do need new binaries for the i386, amd64 folders. Would you like to make the so file?

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

I've made the update v4.1.0.20... Let's try.

from clrzmq4.

metadings avatar metadings commented on July 23, 2024

I'm going to close this issue, because I changed to lookup for the .so on Linux in multiple folders.

Now I'm also using a method EnumerateLibLdConf which enumerates ld.so.conf;
with the directive include /etc/ld.so.conf.d/*.conf, the method also looks into folders /lib/, /usr/lib/, /usr/local/lib/ etc.

from clrzmq4.

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.