Reputation: 101
When I use command "gcc .. ../../*.so
", there are the following error messages:
/usr/bin/ld: /home/demonwnb/build/src/*.so: error: undefined reference to 'llvm::raw_ostream::operator<<(void const*)'
/usr/bin/ld: /home/demonwnb/build/src/*.so: error: undefined reference to 'clang::DeclarationName::printName(llvm::raw_ostream&) const'
I think that I do not link "llvm library" correctly, so how should I do?
Upvotes: 4
Views: 7780
Reputation: 2051
You need to tell your compiler where to load the libraries from, which can be done using the llvm-config command.
You could set the following symbols in your makefile
CC = g++
LLVM_MODULES = core jit native
CPPFLAGS = `llvm-config --cppflags $(LLVM_MODULES)`
LDFLAGS = `llvm-config --ldflags $(LLVM_MODULES)`
LIBS = `llvm-config --libs $(LLVM_MODULES)`
all:
$(CC) *.o $(LDFLAGS) $(LIBS) -o MyOutput
main:
find -name '*.cpp' -print0 | xargs -0 $(CC) -c $(CPPFLAGS)
Upvotes: 8
Reputation: 14053
Did you try using g++ to do the link? Those are C++ libraries and gcc doesn't pass the C++ libraries to the linker.
Upvotes: 1