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

[Bug] Build failed with undefined reference to `setupterm' on Ubuntu Linux #24

Closed
dougpuob opened this issue Aug 24, 2019 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@dougpuob
Copy link
Owner

dougpuob commented Aug 24, 2019

  • undefined reference to setupterm
  • undefined reference to tigetnum
  • undefined reference to set_curterm
  • undefined reference to del_curterm

LLVM libraries built with this command

$ cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=ON -G "Unix Makefiles" ../llvm

Full error message

[ 80%] Linking CXX executable Output/cppnamelint
/home/dougpuob/working-folder/llvm-project/8.0.0/build/lib/libLLVMSupport.a(Process.cpp.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x5c): undefined reference to `setupterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x6c): undefined reference to `tigetnum'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x78): undefined reference to `set_curterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x80): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status
CMakeFiles/cppnamelint.dir/build.make:306: recipe for target 'Output/cppnamelint' failed
make[2]: *** [Output/cppnamelint] Error 1
CMakeFiles/Makefile2:69: recipe for target 'CMakeFiles/cppnamelint.dir/all' failed
make[1]: *** [CMakeFiles/cppnamelint.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

image

@dougpuob dougpuob added the bug Something isn't working label Aug 24, 2019
@dougpuob dougpuob self-assigned this Aug 24, 2019
@dougpuob dougpuob changed the title [Bug] Failed to build CppNameLint on Ubuntu Linux [Bug] Build failed with undefined reference to `setupterm' on Ubuntu Linux Aug 24, 2019
@dougpuob
Copy link
Owner Author

Build LLVM with -DLLVM_ENABLE_TERMINFO=OFF option, then build CppNameLint with -ltinfo option.

Buil LLVM with -DLLVM_ENABLE_TERMINFO=OFF option

$ cmake -DCMAKE_BUILD_TYPE=Release              \
               -DLLVM_ENABLE_PROJECTS=clang     \
               -DLLVM_ENABLE_RTTI=ON            \
               -DLLVM_ENABLE_TERMINFO=OFF       \
               -G "Unix Makefiles"              \
               ../llvm                          \
               > logfile-cmake.log 2>&1

Build CppNameLint project with -ltinfo option

set(CMAKE_CXX_FLAGS "-frtti -lz -ltinfo")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant