You are not logged in.

#1 2016-06-09 22:02:39

incertia
Member
Registered: 2014-10-25
Posts: 29

undefined referenced when trying to use libclangFormat

i can't compile anything that uses libclang (specifically libclangFormat). code compiles fine whenever i remove the libclang specific code. using -lclang -lclangFormat doesn't change anything (still get "undefined reference to `clang::format::getLLVMStyle()'" etc) and linking my object files with /usr/lib/libclangFormat.a or /usr/lib/libclang*.a just lead to more undefined references. i've tried searching the internets but couldn't find anything detailing what i should link with to find libclang symbols.

Offline

#2 2016-06-19 12:49:22

matthew_TKA
Member
From: Texas
Registered: 2016-06-02
Posts: 34
Website

Re: undefined referenced when trying to use libclangFormat

Can you share some more information on your setup?

Which compiler and version are you using?

Do you mind sharing your Makefile or compiler parameters?

Also note that I recently was bit by `undefined reference to` linker errors that actually happened to be caused by C++11 ABI incompatibility issues with GCC 5.0 and the latest Clang.  Basically I had built LLVM with GCC and then was trying to build my project with clang++, which normally should be ok, but due to this bug it wouldn't work.  If you are using C++11 you may want to check out my post here.  It doesn't hurt to also ask your question on StackOverflow as well if you haven't already.


MSI GS40 6QE PHANTOM
Website

Offline

Board footer

Powered by FluxBB