1

I am using Fedora 28 with Eclipse Version: Oxygen.3a. I have already installed the add-on for LLVM-Clang from "Install new software". I am using GCC/G++ 8.1.1.

I built Clang using ninja build system, and it works perfectly fine from command line. I am interested in LibTooling library, so, it serves my purpose. Then, I was trying to setup Eclipse with Clang (mainly for easy debugging), but it Eclipse always gives me linker errors.

I tried 2 solutions:

  1. Followed this thread Unable to install LLVM toolchain for Eclipse CDT. I made a hello world project, and I get the errors:

    clang++ -I/home/hassan/Tools/llvm-clang/llvm/include -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -std=c++0x -o src/clang_test.bc ../src/clang_test.cpp clang++ -L/usr/lib/gcc/x86_64-redhat-linux/8/32/ -L/home/hassan/Tools/llvm-clang/build/bin -o clang_test src/clang_test.bc -lstdc++

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libstdc++.so when searching for -lstdc++

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libstdc++.so when searching for -lstdc++

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libgcc_s.so when searching for -lgcc_s

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libgcc.a when searching for -lgcc

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libgcc_s.so when searching for -lgcc_s

    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/32//libgcc.a when searching for -lgcc

  2. I set the include paths/lib paths to my already built (ninja build system) directory. It compiles fine without any problems, but I get linker errors, e.g., llvm::outs() could not be identified.

If anyone can point me in the right direction, that would be great. Thanks.

Muhammad Hassan
  • 501
  • 1
  • 4
  • 14

0 Answers0