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

Build for TDLib Java example failed #3206

Open
danielfcastro opened this issue Jan 3, 2025 · 3 comments
Open

Build for TDLib Java example failed #3206

danielfcastro opened this issue Jan 3, 2025 · 3 comments

Comments

@danielfcastro
Copy link

danielfcastro commented Jan 3, 2025

  1. Followed the instructions for the build from here - https://tdlib.github.io/td/build.html?language=Java
    2 . Followed instructions from here - https://github.com/tdlib/td/tree/master/example/java
  2. Used -A x64 on step above
  3. When I go to the second set of for lines instruction to build [After this you can compile the example source code:]
  4. Run cmake --build . --target install

Then the attached file with the error happens
cmake.log

@danielfcastro danielfcastro changed the title Build for Java client faileed Build for TDLib Java example failed Jan 4, 2025
@levlam
Copy link
Contributor

levlam commented Jan 4, 2025

The error means that you are trying to link a debug DLL with a release DLL, which shouldn't happen if build instructions provided at https://tdlib.github.io/td/build.html?language=Java are used. It may help to run the build instructions in the new directory from scratch.

@levlam
Copy link
Contributor

levlam commented Jan 4, 2025

You don't need to use instructions from https://github.com/tdlib/td/tree/master/example/java if you use https://tdlib.github.io/td/build.html?language=Java.

@danielfcastro
Copy link
Author

danielfcastro commented Jan 7, 2025

Can you add this remark on the README.MD so the instructions become clearer?

Important points to make documentation better.

  1. Very confusing instructions about how to compile and no description about where the compiled artifacts are. There is a folder on description td/tdlib with dlls inside and org folder with many classes along its directory structure.
  • libcrypto-3-x64
  • libssl-3-x64
  • tdjni
  • zlib1
  1. Is supposed to do a JNI configuration referencing this 4 dlls? If so, how to make it?
    It is unclear how to integrate the dlls using JNI so it can be added as dependency on any java project.

  2. TDLib provides native Java interface through JNI. To enable it, specify option -DTD_ENABLE_JNI=ON to CMake.

Here https://tdlib.github.io/td/build.html?language=Java it already have this parameter. The instruction above can be misleading.

  1. Other insights
    Offer an example on how to use the lib using JNI to integrate on a Java project (Spring Boot + Gradle / Maven)

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

No branches or pull requests

2 participants