tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.23k stars 1.47k forks source link

[Java Linux 64-bit] no org.drinkless.tdlib.TdApi.java generated on successful build #409

Closed DmitrySoftware closed 6 years ago

DmitrySoftware commented 6 years ago

Hello,

I'm following TDLib Java example building guide and in can't find generated org.drinkless.tdlib.TdApi.java in /example/java, did I miss something? I'm building on linux 64-bit and it seems to compile just fine with a few warnings. I will attach some output. I've tried building with oracle jdk and openjdk with the same result.

Also, I've tried precompiled version, but it requires OpenSSL 1.0.2 which is not available in my target system.

Thanks in advance.

Dependencies

C++14 compatible compiler: gcc 7.3.1 OpenSSL: 1.1.0i-fips zlib: 1.2.11-lp150.2.3.1 gperf: GNU gperf 3.1 CMake: 3.10.2 PHP: 7.2.5 JDK: tried with oracle jdk1.8.0_191-amd64 and openjdk version "11.0.1" 2018-10-16 by changing JAVA_HOME environment variable

Contents of "/example/java" directory:

├── CMakeLists.txt
├── org
│   └── drinkless
│       └── tdlib
│           ├── Client.java
│           ├── example
│           │   └── Example.java
│           └── Log.java
├── README.md
├── td
│   ├── bin
│   │   ├── td
│   │   │   └── generate
│   │   │       ├── JavadocTlDocumentationGenerator.php
│   │   │       ├── scheme
│   │   │       │   ├── td_api.tl
│   │   │       │   └── td_api.tlo
│   │   │       └── TlDocumentationGenerator.php
│   │   └── td_generate_java_api
│   ├── include
│   │   └── td
│   │       ├── telegram
│   │       │   ├── Client.h
│   │       │   ├── Log.h
│   │       │   ├── td_api.h
│   │       │   ├── td_api.hpp
│   │       │   ├── td_json_client.h
│   │       │   ├── tdjson_export.h
│   │       │   └── td_log.h
│   │       └── tl
│   │           ├── tl_jni_object.h
│   │           └── TlObject.h
│   └── lib
│       ├── cmake
│       │   └── Td
│       │       ├── TdConfig.cmake
│       │       ├── TdConfigVersion.cmake
│       │       ├── TdTargets.cmake
│       │       └── TdTargets-release.cmake
│       ├── libtdactor.a
│       ├── libtdclient.a
│       ├── libtdcore.a
│       ├── libtddb.a
│       ├── libtdjson_private.a
│       ├── libtdjson.so
│       ├── libtdjson_static.a
│       ├── libtdnet.a
│       ├── libtdsqlite.a
│       └── libtdutils.a
└── td_jni.cpp

16 directories, 34 files

Warnings

cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -CMAKE_INSTALL_PREFIX:PATH=../example/java/td ..
[ 29%] Building CXX object tdnet/CMakeFiles/tdnet.dir/td/net/GetHostByNameActor.cpp.o
In file included from <path_to_TDLib_sources>/tdutils/td/utils/misc.h:12:0,
                 from <path_to_TDLib_sources>/tdutils/td/utils/MpscPollableQueue.h:9,
                 from <path_to_TDLib_sources>/tdactor/td/actor/impl/Scheduler-decl.h:17,
                 from <path_to_TDLib_sources>/tdactor/td/actor/impl/Actor.h:11,
                 from <path_to_TDLib_sources>/tdactor/td/actor/actor.h:9,
                 from <path_to_TDLib_sources>/tdnet/td/net/GetHostByNameActor.h:9,
                 from <path_to_TDLib_sources>/tdnet/td/net/GetHostByNameActor.cpp:7:
<path_to_TDLib_sources>/tdutils/td/utils/Status.h: In member function ‘td::Result<td::IPAddress> td::GetHostByNameActor::load_ip(td::string, int, bool)’:
<path_to_TDLib_sources>/tdutils/td/utils/Status.h:339:7: warning: ‘*((void*)<anonymous>+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       new (&value_) T(std::move(other.value_));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 29%] Building CXX object tdnet/CMakeFiles/tdnet.dir/td/net/HttpChunkedByteFlow.cpp.o

...

[ 65%] Building CXX object td/generate/CMakeFiles/generate_json.dir/tl_json_converter.cpp.o
In file included from <path_to_TDLib_sources>/tdutils/td/utils/logging.h:30:0,
                 from <path_to_TDLib_sources>/tdutils/td/utils/buffer.h:10,
                 from <path_to_TDLib_sources>/td/generate/tl_json_converter.cpp:11:
<path_to_TDLib_sources>/tdutils/td/utils/StringBuilder.h: In function ‘void td::gen_json_converter_file(const td::tl::simple::Schema&, const string&, bool)’:
<path_to_TDLib_sources>/tdutils/td/utils/StringBuilder.h:22:83: warning: array subscript is below array bounds [-Warray-bounds]
       : begin_ptr_(slice.begin()), current_ptr_(begin_ptr_), end_ptr_(slice.end() - reserved_size) {
                                                                       ~~~~~~~~~~~~^~~~~~~~~~~~~~~
[ 66%] Linking CXX executable generate_json

cmake --build . --target install

[ 28%] Generate common tl source files
Function initConnection is too hard to store
Function invokeAfterMsg is too hard to store
Function invokeAfterMsgs is too hard to store
Function invokeWithLayer is too hard to store
Function invokeWithMessagesRange is too hard to store
Function invokeWithTakeout is too hard to store
Function invokeWithoutUpdates is too hard to store
Function initConnection is too hard to store
Function invokeAfterMsg is too hard to store
Function invokeAfterMsgs is too hard to store
Function invokeWithLayer is too hard to store
Function invokeWithMessagesRange is too hard to store
Function invokeWithTakeout is too hard to store
Function invokeWithoutUpdates is too hard to store
Function initConnection is too hard to store
Function invokeAfterMsg is too hard to store
Function invokeAfterMsgs is too hard to store
Function invokeWithLayer is too hard to store
Function invokeWithMessagesRange is too hard to store
Function invokeWithTakeout is too hard to store
Function invokeWithoutUpdates is too hard to store
[ 28%] Built target tl_generate_common

Output of "installing" phase:

Install the project...
-- Install configuration: "Release"
-- Installing: tdlib/jnibuild/../example/java/td/lib/libtdjson.so
-- Set runtime path of "../example/java/td/lib/libtdjson.so" to ""
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdjson_static.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdjson_private.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdclient.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdcore.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/cmake/Td/TdTargets.cmake
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/cmake/Td/TdTargets-release.cmake
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/td_json_client.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/td_log.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/tdjson_export.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/Client.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/Log.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/tl/TlObject.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/td_api.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/telegram/td_api.hpp
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/include/td/tl/tl_jni_object.h
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/cmake/Td/TdConfig.cmake
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/cmake/Td/TdConfigVersion.cmake
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdutils.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/bin/td_generate_java_api
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/bin/td/generate/JavadocTlDocumentationGenerator.php
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/bin/td/generate/TlDocumentationGenerator.php
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/bin/td/generate/scheme/td_api.tlo
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/bin/td/generate/scheme/td_api.tl
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdactor.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdnet.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtdsqlite.a
-- Installing: <path_to_TDLib_sources>/jnibuild/../example/java/td/lib/libtddb.a
levlam commented 6 years ago

Warinngs are false positives from new GCC. TDLib is compiled and installed fine to <path_to_TDLib_sources>/example/java/td, but you need to build also JNI bindigns. You need to follow second part of https://github.com/tdlib/td/blob/master/example/java/README.md from "Then you can build this example:".

DmitrySoftware commented 6 years ago

Thanks for your help!