Displaying 1 result from an estimated 1 matches for "libsquar".
Did you mean:
libsqora
2013 Jul 29
1
[LLVMdev] llvm-g++ 4.6.4 unable to compile simple shared library on Ubuntu 12.04 x86_64
...c BEGIN *****/
#include <stdio.h>
int
main(int argc,char *argv[] ) {
int i = 0;
for( i = 0; i < 10 ; i ++ ) {
printf("%d\n",squared(i));
}
}
/**** END *******/
Using llvm-gcc works just fine:
llvm-gcc -fPIC -c -o squared.o squared.c
llvm-gcc -shared -o libsquared.so squared.o
llvm-gcc -L. -o main main.c -lsquared
LD_LIBRARY_PATH=. ./main
0
1
4
9
16
25
36
49
64
81
The creation of the shared library fails when using llvm-g++
llvm-g++ -fPIC -c -o squared.o squared.c
llvm-g++ -shared -o libsquared.so squared.o
/usr/bin/ld: squared.o: relocation R_X86...