Closed bit69tream closed 2 years ago
I suspect your CMake version (cmake --version
) is older than 3.10, and nchat uses a feature in CMake >= 3.10 to correctly detect one of its dependencies - libncursesw.
If possible, try upgrading CMake to a version >= 3.10, alternatively as a workaround you can change the following line in CMakeLists.txt
:
target_link_libraries(nchat PUBLIC tdclientshared ${CURSES_NCURSES_LIBRARY})
to:
target_link_libraries(nchat PUBLIC tdclientshared ncursesw)
and try build again. Please let me know if it works. Thanks.
To prevent others from encountering this issue I'll probably enforce the suitable minimum CMake version.
Sorry The problem was in ncurses lib
I tried to compile another project with ncurses and the error was the same
I fixed the problem
I added target_link_libraries(nchat PUBLIC tdclientshared tinfow)
Great to hear you found a solution. Do you mind sharing which cmake version you were using btw?
Finally got a chance to properly look into this, as I got access to a Gentoo system. Reproduced it with below steps and result.
Steps performed:
emerge -n dev-vcs/git
git clone https://github.com/d99kris/nchat
cd nchat
emerge -n dev-util/cmake dev-util/gperf sys-apps/help2man sys-libs/readline dev-libs/openssl sys-libs/ncurses sys-libs/zlib dev-db/sqlite sys-apps/file
mkdir -p build && cd build && cmake .. && make -sj8
Result:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/nchat.dir/src/ui.cpp.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
This has been fixed in the above commit. Build should be successful using standard commands:
mkdir -p build && cd build && cmake .. && make -s
It errors on 100% and I don't know why.
All dependencies are installed. Distro: Gentoo Linux Compile log: https://pastebin.com/1WkqxmYY GCC/G++ version: 8.3.0