From 19d311ab9a97c21ca56a7bca57ed43987e27da2c Mon Sep 17 00:00:00 2001 From: Ciprian Date: Sun, 16 Aug 2015 20:52:44 -0700 Subject: [PATCH] Fix compiling under 64 bit linux The compile command needs -m32 tacked onto there or LD will complain: $ make g++ -fPIC -O3 -c btime.cpp g++ btime.o -O3 -m32 -lstdc++ -lrt -shared -Wl,-soname,btime.so -o btime.so /usr/bin/ld: i386:x86-64 architecture of input file `btime.o' is incompatible with i386 output /usr/bin/ld: btime.o: file class ELFCLASS64 incompatible with ELFCLASS32 /usr/bin/ld: final link failed: File in wrong format collect2: error: ld returned 1 exit status --- btime/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btime/Makefile b/btime/Makefile index e936aea..ad3955c 100644 --- a/btime/Makefile +++ b/btime/Makefile @@ -1,7 +1,7 @@ all: compile link compile: - g++ -fPIC -O3 -c btime.cpp + g++ -fPIC -O3 -c btime.cpp -m32 link: g++ btime.o -O3 -m32 -lstdc++ -lrt -shared -Wl,-soname,btime.so -o btime.so