Cannot compile on Ubuntu 24.04.1 with GCC
I am encountering the same issue I mentioned in the discussion down below, even though it has been resolved by @farid-cs by installing ncurses headers. My setup is as follows:
- OS: Ubuntu 24.04.1
- Compiler: GCC (not musl)
- cmake-tools version: 1.20.36
- cmake version: 0.0.17 (VSc extension)
Steps Taken
I have attempted the following to resolve the issue:
- Re-installed the required libraries (tried multiple versions).
- Cloned the repository again.
Despite these attempts, the issue persists when building the project via the Visual Studio Code extension CMake Tools. However, when I build C3 Compiler using the terminal, it works without any issues.
Discussed in https://github.com/c3lang/c3c/discussions/1817
Originally posted by farid-cs January 11, 2025 I tryed to compile on Void Linux musl version following all the instructions, but if failed with the following error:
CMake Error at /usr/lib/cmake/llvm/LLVMExports.cmake:73 (set_target_properties):
The link interface of target "LLVMSupport" contains:
Terminfo::terminfo
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/LLVMConfig.cmake:353 (include)
CMakeLists.txt:149 (find_package)
I had something similar as a problem when using CMake from within CLion. Basically the environment variables were different in some way, so I always had to explicitly add these:
-DLLVM_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/llvm
-DLLD_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/lld
Could something similar help you?
I had something similar as a problem when using CMake from within CLion. Basically the environment variables were different in some way, so I always had to explicitly add these:
-DLLVM_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/llvm -DLLD_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/lldCould something similar help you?
Thanks for the info, I'll let you know when I'll try to change the env variables as you said.
Unfortunately, even after applying the fix you proposed, the error is still present.
The issue is still present and still I have no idea how to fix it.
The build works fine with clang with this Dockerfile/Containerfile I made. @Adversing
ARG UBUNTU_VERSION=24.04
FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install cmake git clang zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev
RUN cd ~ && git clone https://github.com/c3lang/c3c.git && cd c3c && cmake -B build -S . && cmake --build build && ./build/c3c --version
ENTRYPOINT ~/c3c/build/c3c
Just install podman from apt, then podman build --tag c3c .
This Dockerfile has gcc instead of clang and it also worked.
ARG UBUNTU_VERSION=24.04
FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install cmake git build-essential gcc zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev
RUN cd ~ && git clone https://github.com/c3lang/c3c.git && cd c3c && cmake -B build -S . && cmake --build build && ./build/c3c --version
ENTRYPOINT ~/c3c/build/c3c