tdlib / td

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

example/cpp/td_example.cpp can not run, td/telegram/td_api.h can not found #2922

Closed kannr closed 1 week ago

kannr commented 4 months ago

build command

git clone https://github.com/tdlib/td.git cd td mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Debug -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DCMAKE_INSTALL_PREFIX:PATH=../example/cpp/td .. cmake --build . --target install cd ../example/cpp rm -rf build mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Debug -DTd_DIR=/Users/cy/td/example/cpp/td/lib/cmake/Td .. cmake --build .

when i run td_example.cpp

fatal error: 'td/telegram/Client.h' file not found

include <td/telegram/Client.h>

     ^~~~~~~~~~~~~~~~~~~~~~

1 error generated.

the clion ide compilation failed.

截屏2024-06-09 11 25 27
levlam commented 4 months ago

The build likely succeeded, and the file td_example.exe has been generated by the command cmake --build ..

If you want to edit the example in CLion and build from there, then you must ensure to create the project from the CMake file and use it with the same options as specified at the command line, namely, Td_DIR=/Users/cy/td/example/cpp/td/lib/cmake/Td