I'm trying to compile a sample LLVM program. The linker step uses this command.
llvm-config-3.2 --ldflags --libs
That results in the following command.
g++ -o bin/Debug/test-llvm obj/Debug/main.o -L/usr/lib/llvm-3.2/lib -lpthread -lffi -ldl -lm (a boat load of LLVM libraries here)
However, it fails to link. I get errors like this.
undefined reference to ffi_type_float
So, I added -lffi
and -ldl
to the end.
g++ -o bin/Debug/test-llvm obj/Debug/main.o -L/usr/lib/llvm-3.2/lib -lpthread -lffi -ldl -lm (a boat load of LLVM libraries here) -lffi -ldl
So, yes, they show up TWICE in the command... but it works this way. Why? They are clearly referenced earlier in the arguments.