Comments (9)
Some TDLib sources are generated and that can't be done directly when the library is cross-compiled. You need to run ones a native build to generate these sources before running cross-compilation:
mkdir build_native
cd build_native
cmake ..
cmake --build . --target prepare_cross_compiling
from td.
Thanks for response!
Tried, but no luck.. Same error message as above, but in another place:
doctorrokter@MISHA-PC:~/dev/td/build$ cmake --build . --target prepare_cross_compiling
Scanning dependencies of target tdtl
[ 0%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_config.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_core.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_file_outputer.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_generate.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_outputer.cpp.o
[ 25%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_string_outputer.cpp.o
[ 25%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_writer.cpp.o
[ 25%] Linking CXX static library libtdtl.a
[ 25%] Built target tdtl
Scanning dependencies of target generate_common
[ 25%] Building CXX object td/generate/CMakeFiles/generate_common.dir/generate_common.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_cpp.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_h.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_hpp.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_jni_cpp.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_jni_h.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_td.cpp.o
[ 62%] Linking CXX executable generate_common
[ 62%] Built target generate_common
Scanning dependencies of target tl_generate_common
[ 75%] Generate common tl source files
/home/doctorrokter/dev/td/build/td/generate/generate_common: 1: /home/doctorrokter/dev/td/build/td/generate/generate_common: Syntax error: word unexpected (expecting ")")
td/generate/CMakeFiles/tl_generate_common.dir/build.make:61: recipe for target 'td/generate/CMakeFiles/tl_generate_common' failed
make[3]: *** [td/generate/CMakeFiles/tl_generate_common] Error 2
CMakeFiles/Makefile2:708: recipe for target 'td/generate/CMakeFiles/tl_generate_common.dir/all' failed
make[2]: *** [td/generate/CMakeFiles/tl_generate_common.dir/all] Error 2
CMakeFiles/Makefile2:242: recipe for target 'CMakeFiles/prepare_cross_compiling.dir/rule' failed
make[1]: *** [CMakeFiles/prepare_cross_compiling.dir/rule] Error 2
Makefile:225: recipe for target 'prepare_cross_compiling' failed
make: *** [prepare_cross_compiling] Error 2
from td.
Could you show output of
make VERBOSE=1 prepare_cross_compiling
?
from td.
Yep, sure:
make VERBOSE=1 prepare_cross_compiling
/usr/bin/cmake -H/root/dev/td -B/root/dev/td/build --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 prepare_cross_compiling
make[1]: Entering directory '/root/dev/td/build'
/usr/bin/cmake -H/root/dev/td -B/root/dev/td/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /root/dev/td/build/CMakeFiles 8
make -f CMakeFiles/Makefile2 CMakeFiles/prepare_cross_compiling.dir/all
make[2]: Entering directory '/root/dev/td/build'
make -f tdtl/CMakeFiles/tdtl.dir/build.make tdtl/CMakeFiles/tdtl.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/tdtl /root/dev/td/build /root/dev/td/build/tdtl /root/dev/td/build/tdtl/CMakeFiles/tdtl.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f tdtl/CMakeFiles/tdtl.dir/build.make tdtl/CMakeFiles/tdtl.dir/build
make[3]: Entering directory '/root/dev/td/build'
make[3]: Nothing to be done for 'tdtl/CMakeFiles/tdtl.dir/build'.
make[3]: Leaving directory '/root/dev/td/build'
[ 25%] Built target tdtl
make -f td/generate/CMakeFiles/generate_common.dir/build.make td/generate/CMakeFiles/generate_common.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/td/generate /root/dev/td/build /root/dev/td/build/td/generate /root/dev/td/build/td/generate/CMakeFiles/generate_common.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f td/generate/CMakeFiles/generate_common.dir/build.make td/generate/CMakeFiles/generate_common.dir/build
make[3]: Entering directory '/root/dev/td/build'
make[3]: Nothing to be done for 'td/generate/CMakeFiles/generate_common.dir/build'.
make[3]: Leaving directory '/root/dev/td/build'
[ 62%] Built target generate_common
make -f td/generate/CMakeFiles/tl_generate_common.dir/build.make td/generate/CMakeFiles/tl_generate_common.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/td/generate /root/dev/td/build /root/dev/td/build/td/generate /root/dev/td/build/td/generate/CMakeFiles/tl_generate_common.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f td/generate/CMakeFiles/tl_generate_common.dir/build.make td/generate/CMakeFiles/tl_generate_common.dir/build
make[3]: Entering directory '/root/dev/td/build'
[ 75%] Generate common tl source files
cd /root/dev/td/td/generate && /root/dev/td/build/td/generate/generate_common
/root/dev/td/build/td/generate/generate_common: 1: /root/dev/td/build/td/generate/generate_common: Syntax error: word unexpected (expecting ")")
td/generate/CMakeFiles/tl_generate_common.dir/build.make:61: recipe for target 'td/generate/CMakeFiles/tl_generate_common' failed
make[3]: *** [td/generate/CMakeFiles/tl_generate_common] Error 2
make[3]: Leaving directory '/root/dev/td/build'
CMakeFiles/Makefile2:707: recipe for target 'td/generate/CMakeFiles/tl_generate_common.dir/all' failed
make[2]: *** [td/generate/CMakeFiles/tl_generate_common.dir/all] Error 2
make[2]: Leaving directory '/root/dev/td/build'
CMakeFiles/Makefile2:242: recipe for target 'CMakeFiles/prepare_cross_compiling.dir/rule' failed
make[1]: *** [CMakeFiles/prepare_cross_compiling.dir/rule] Error 2
make[1]: Leaving directory '/root/dev/td/build'
Makefile:225: recipe for target 'prepare_cross_compiling' failed
make: *** [prepare_cross_compiling] Error 2
Also, found this https://stackoverflow.com/questions/36725864/syntax-error-word-unexpected-expecting
But not sure that it can help.
from td.
I could guess you are trying to call make prepare_cross_compiling with arm complier. It should be run in a separate build directory with a native compiler.
The original problem is probably because CMAKE_CROSSCOMPILING is not set.
from td.
Oh, I'm confused much more :)
Let's start from scratch.
The goal: build native telegram app for BlackBerry 10 with branded UI. For this I need 2 versions of TDlib - x86 (for running on bb10 simulator on x86 machine) and arm (for running on device). The built libs need to be included in Momentics IDE and then use it in my code (Qt4.8 app).
As described above, there are no problems with x86 build, I made all by instructions provided in Readme.md, and installed compiled libs into my custom dir.
Then I removed the build directory, configured cross compiler:
export CROSS=/home/doctorrokter/dev/arm/gcc-linaro-7.2.1/bin/arm-linux-gnueabihf
export CC=${CROSS}-gcc
export CXX=${CROSS}-g++
mkdir build // create from scratch
cd build
cmake -DCMAKE_INSTALL_PREFIX=/my_dir -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING=True ..
This should configure with cross compiler. And when I run
cmake --build . // command from build instructions
OR
cmake --build. --target prepare_cross_compiling
it uses provided cross compiler and fails with error above. How to run prepare_cross_compiling with native compiler if build dir already configured for cross compiler?
from td.
You should run prepare_cross_compiling from a separate build directory.
from td.
Yes, finally! This did the trick.
It also required some manual work from me (for example, I got error during generate_common target and solved it by copying generate_common file from build_native to build dir and so on) , but all is ok.
Thank you guys for helping!
from td.
I'm having trouble compiling for armv7 (for the raspberry), I did not understand how you solved it; I tried all but once done prepare_cross_compiling, then when I start compiling it does for x86 instead of arm although I have set the libraries for arm
Could you write me all the steps to fill out correctly for arm?
from td.
Related Issues (20)
- Separate message_ids in the same post HOT 3
- PHP code fails to compile: `Unsupported tl-schema version -1` HOT 10
- Unknown error in class "messageReplyToMessage" HOT 1
- "Request is empty" on authorization in Ubuntu HOT 4
- How do I launch the bot correctly? HOT 2
- Can someone show the references of the SetAuthenticationPhoneNumber() function HOT 3
- Telegram
- I need to build libtdjsonandroid to work on android using Unity (C#) HOT 1
- GetSupergroup return error "400 Invalid supergroup identifier" HOT 1
- Why I cannot create this json format to send text? HOT 8
- user-bot rate limit HOT 6
- Isn't there an instant way to change the hint password? HOT 3
- How to buy/subscribe to Telegram Business/Premium on Test DC? HOT 2
- Problem with secret messaging in Telegram X HOT 3
- Exclude x86 libs from android build? HOT 1
- When send voicenote with own client official desktop telegram shows it strange HOT 8
- [static const] please write code that complies with the C++ standard HOT 5
- How often does TDLib phone back to server to decide on the connection state? HOT 2
- Delays in getting message updates from some specific channels HOT 5
- step stuck:Please enter phone number HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from td.