ton-blockchain / ton

Main TON monorepo
Other
3.04k stars 953 forks source link

Build error: undefined reference to `io_uring_queue_init' #431

Closed kazei92 closed 2 years ago

kazei92 commented 2 years ago

While I am building using Cmake according to https://github.com/ton-blockchain/ton/tree/master/tonlib

cd <path to Ton sources>
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../example/cpp/tonlib ..
cmake --build . --target install

Building process stops at:

[ 54%] Linking CXX executable test-vm
/usr/bin/ld: third-party/rocksdb/librocksdb.a(fs_posix.cc.o): in function `rocksdb::(anonymous namespace)::PosixFileSystem::PosixFileSystem()':
fs_posix.cc:(.text+0x392): undefined reference to `io_uring_queue_init'
/usr/bin/ld: third-party/rocksdb/librocksdb.a(io_posix.cc.o): in function `rocksdb::PosixRandomAccessFile::MultiRead(rocksdb::FSReadRequest*, unsigned long, rocksdb::IOOptions const&, rocksdb::IODebugContext*)':
io_posix.cc:(.text+0x7134): undefined reference to `io_uring_submit_and_wait'
/usr/bin/ld: io_posix.cc:(.text+0x71e9): undefined reference to `__io_uring_get_cqe'
/usr/bin/ld: io_posix.cc:(.text+0x8213): undefined reference to `io_uring_queue_init'
/usr/bin/ld: io_posix.cc:(.text+0x845d): undefined reference to `__io_uring_get_cqe'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/test-vm.dir/build.make:154: test-vm] Error 1
make[1]: *** [CMakeFiles/Makefile2:1616: CMakeFiles/test-vm.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

My system: Arch Linux (5.18.15-arch1-2) on Intel

Could you please help me to fix it?

EmelyanenkoK commented 2 years ago

Have you managed to solve the issue? Which compilator are you using?

kazei92 commented 2 years ago

I haven't, but as I need only tonlib - I have compiled with the -DTON_ONLY_TONLIB=ON and it worked.

2ico commented 2 years ago

I still have the same issue. Why is it completed?

XiaoChenQAQ commented 1 year ago

add -luring in the end, like: g++ main.cpp -luring.