td icon indicating copy to clipboard operation
td copied to clipboard

Build for TDLib Java example failed

Open danielfcastro opened this issue 1 year ago • 3 comments

  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 avatar Jan 03 '25 15:01 danielfcastro

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 avatar Jan 04 '25 17:01 levlam

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.

levlam avatar Jan 04 '25 17:01 levlam

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)

danielfcastro avatar Jan 07 '25 17:01 danielfcastro