Talk:SDCard Testing: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Created page with 'Flashbench does not compile on 12.04 64bit: <blockquote> flashbench/dev.c:35: undefined reference to `clock_gettime' collect2: ld returned 1 exit status </blockquote> To fix th…')
 
No edit summary
 
Line 1: Line 1:
Flashbench does not compile on 12.04 64bit:
Flashbench does not compile on Ubuntu 12.04 64bit:


flashbench/dev.c:35: undefined reference to `clock_gettime'
<blockquote>
collect2: ld returned 1 exit status
flashbench/dev.c:35: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
</blockquote>


To fix this, the flag -lrt has to go at the end of the linking line of flashbench, ie
To fix this, the flag -lrt has to go at the end of the linking line of flashbench, ie


diff --git a/Makefile b/Makefile
<blockquote>
index 8fbd119..4c04f5e 100644
diff --git a/Makefile b/Makefile
--- a/Makefile
index 8fbd119..4c04f5e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
+++ b/Makefile
CC := gcc
@@ -1,6 +1,6 @@
-CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
CC := gcc
-LDFLAGS := -lrt
-CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
+CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
-LDFLAGS := -lrt
+LDFLAGS :=
+CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
+LDFLAGS :=
all: flashbench erase
all: flashbench erase
@@ -8,7 +8,7 @@ dev.o: dev.c dev.h
@@ -8,7 +8,7 @@ dev.o: dev.c dev.h
vm.o: vm.c vm.h dev.h
vm.o: vm.c vm.h dev.h
flashbench.o: flashbench.c vm.h dev.h
flashbench.o: flashbench.c vm.h dev.h
-flashbench: flashbench.o dev.o vm.o
-flashbench: flashbench.o dev.o vm.o
+flashbench: flashbench.o dev.o vm.o -lrt
+flashbench: flashbench.o dev.o vm.o -lrt
erase: erase.o
erase: erase.o
</blockquote>

Latest revision as of 08:31, 15 May 2012

Flashbench does not compile on Ubuntu 12.04 64bit:

flashbench/dev.c:35: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

To fix this, the flag -lrt has to go at the end of the linking line of flashbench, ie

diff --git a/Makefile b/Makefile
index 8fbd119..4c04f5e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 CC     := gcc
-CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
-LDFLAGS := -lrt
+CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-paramet
+LDFLAGS := 
 
 all: flashbench erase
 
@@ -8,7 +8,7 @@ dev.o: dev.c dev.h
 vm.o: vm.c vm.h dev.h
 flashbench.o: flashbench.c vm.h dev.h
 
-flashbench: flashbench.o dev.o vm.o
+flashbench: flashbench.o dev.o vm.o -lrt
 
 erase: erase.o