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

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

Open
kannr opened this issue Jun 9, 2024 · 1 comment
Open

Comments

@kannr
Copy link

kannr commented Jun 9, 2024

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
Copy link
Contributor

levlam commented Jun 9, 2024

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

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