Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run in android failed. #1

Closed
gaobaiq opened this issue Oct 21, 2021 · 29 comments
Closed

run in android failed. #1

gaobaiq opened this issue Oct 21, 2021 · 29 comments

Comments

@gaobaiq
Copy link

gaobaiq commented Oct 21, 2021

Failed to load dynamic library 'liblibzmq-v142-mt-4_3_5.so': dlopen failed: library "liblibzmq-v142-mt-4_3_5.so" not found

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

For Android you need to support libzmq yourself. I have made some changes (which are not published yet), which support other dll/lib names other than liblibzmq-v142-mt-4_3_5 (e.g. libzmq).

But essentially you need to follow these steps, which will get you a libzmq.so. Which you need to include in your project following these steps

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

I hope to get a new version out, where the mentioned steps are not needed anymore

@gaobaiq
Copy link
Author

gaobaiq commented Oct 21, 2021

Very good. I'm trying to do the same. Now I build an so file and try to run the project.

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

Very good. I'm trying to do the same. Now I build an so file and try to run the project.

Also for now you will need to rename libzmq.so to libzmq-v142-mt-4_3_5.so

@gaobaiq
Copy link
Author

gaobaiq commented Oct 21, 2021

Very good. I'm trying to do the same. Now I build an so file and try to run the project.

Also for now you will need to rename libzmq.so to libzmq-v142-mt-4_3_5.so

yes,i did.

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

@gaobaiq I have pushed/released a new version, which has some changes and also adresses an issue with loading the share library. Now it should be possible to just have the library named libzmq.so

@gaobaiq
Copy link
Author

gaobaiq commented Oct 21, 2021

@gaobaiq I have pushed/released a new version, which has some changes and also adresses an issue with loading the share library. Now it should be possible to just have the library named libzmq.so

It's so beautiful.I also want to run my project and share it with you later.

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

Does it work for you? I am also trying to get a simple example running on Android, but it does not find/load the native library

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

Ahh so it seems libc++_shared.so is also needed for this to work
https://developer.android.com/ndk/guides/cpp-support#shared_runtimes

@enwi
Copy link
Owner

enwi commented Oct 21, 2021

Luckily the Android ndk includes compiled versions of these for all platforms

@gaobaiq
Copy link
Author

gaobaiq commented Oct 22, 2021

Ahh so it seems libc++_shared.so is also needed for this to work https://developer.android.com/ndk/guides/cpp-support#shared_runtimes

I failed to build so.

@enwi
Copy link
Owner

enwi commented Oct 22, 2021

Ahh so it seems libc++_shared.so is also needed for this to work https://developer.android.com/ndk/guides/cpp-support#shared_runtimes

I failed to build so.

You don't have to. There are compiled versions of it inside the ndk (ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib)

@gaobaiq
Copy link
Author

gaobaiq commented Oct 22, 2021

You don't have to. There are compiled versions of it inside the ndk (ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib)

I have many problems compiling with r23

@enwi
Copy link
Owner

enwi commented Oct 22, 2021

Ohh gotcha, you need to use r21e for now, newer versions are not supported (zeromq/libzmq#4276)

@gaobaiq
Copy link
Author

gaobaiq commented Oct 22, 2021

Ohh gotcha, you need to use r21e for now, newer versions are not supported (zeromq/libzmq#4276)

OKey, i try it. thx!

@gaobaiq
Copy link
Author

gaobaiq commented Oct 22, 2021

Do you have a compiled so file? Can you share it? My email is [email protected] or [email protected]

@enwi
Copy link
Owner

enwi commented Oct 22, 2021

This zip includes all needed files for android native-libraries.zip

@gaobaiq
Copy link
Author

gaobaiq commented Oct 22, 2021

Ok, thanks!

@enwi
Copy link
Owner

enwi commented Oct 22, 2021

Does it work now?

@enwi
Copy link
Owner

enwi commented Oct 22, 2021

I also just noticed that my compiled version of libzmq does not have support for pgm, tipc, norm, curve, gssapi and draft, but for ipc. So I will have to compile with curv support again (because I need it). I also implemented the zmq_has function so this can be checked during run-time.

@gaobaiq
Copy link
Author

gaobaiq commented Oct 25, 2021

Yes, I also found that the so file you provided does not support the TiCP protocol. And I also tried to run it with my own compiled so file, but it also failed.Now I'm trying to deal with it.

@enwi
Copy link
Owner

enwi commented Oct 25, 2021

I also have no clue how to get it to compile with support for pgm, tipc, norm, gssapi and draft. But lets see what the curve binary has to offer

@gaobaiq
Copy link
Author

gaobaiq commented Oct 25, 2021

I also have no clue how to get it to compile with support for pgm, tipc, norm, gssapi and draft. But lets see what the curve binary has to offer

Yes, we can start with this

@enwi
Copy link
Owner

enwi commented Oct 25, 2021

As you might have noticed I released a new version, now containing checks for different capabilities. Also my new shared binary just has curve support. No pgm, tipc, norm, gssapi and draft.

@enwi
Copy link
Owner

enwi commented Oct 25, 2021

@gaobaiq Do you really need tipc on a mobile platform/Android? I don't see the use case there

@gaobaiq
Copy link
Author

gaobaiq commented Oct 25, 2021

@gaobaiq Do you really need tipc on a mobile platform/Android? I don't see the use case there

The company happened to have this server, so I tried it.

@enwi
Copy link
Owner

enwi commented Oct 25, 2021

But isn't tipc used for interprocess cluster communication? I would say that you would use a normal tcp socket for communication with your frontend/app

@gaobaiq
Copy link
Author

gaobaiq commented Oct 26, 2021

Yes, there is no problem with TCP, but I happen to have a scene that needs it. And I can't use it now.

@enwi
Copy link
Owner

enwi commented Oct 27, 2021

@gaobaiq So I can close this issue now?
I think you will have to figure out how to get a compiled version with tipc yourself. If you manage to get it working I would be happy if you could share your findings. Then I can include them in the readme for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants