Linking fails when compiling files that use llvm routines


I 've built llvm 2.6 in linux, and then i installed it in the system
by 'make install'. However, when i try to compile a file that uses
llvm routines and libraries (by giving the command: "{compiler}
`llvm-config --cxxflags --ldflags --libs all -o Test test.cpp" where i
tried both llvm-g++ and g++ in the {compiler} field), the linking
fails and an "undefined reference to llvm::some_llvm_routine()" error
message is raised. The lib files are actually placed in the
/usr/local/lib directory, but they seem as they do not exist or
something? I would appreciate it very much if any help could be

Yannis Mantzouratos.

Hi Yannis,

It looks like you're missing a second back-quote before the -o. Is that exactly what you've been typing? Have you tried typing llvm-config by itself to see what is supposed to link in?


Hi Sam,

That was a typo, i was actually typing "{compiler} `llvm-config
--cxxflags --ldflags --libs all` -o Test test.cpp". I have already
tried typing llvm-config by itself and everything seemed as expected,
so i suppose that the problem isn't there.


PS: that "Fwd:" in the thread subject is also a nice example of typo :slight_smile: