我试图将表单Ubuntu交叉编译为Friendly-arm,但我收到了一个奇怪的错误:
root@kevin-VirtualBox:/home/kevin/Desktop/makef# make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-l
gcc -o main obj/main.o obj/serial.o obj/fb.o obj/menu_main.o obj/timer.o obj/cmdin.o obj/buzzer.o obj/statemachine.o obj/inout.o obj/network.o obj/text_file_input.o obj/text_file_input_oven.o -I./ -lgd -lrt
/usr/bin/ld: obj/main.o: Relocations in generic ELF (EM: 40)
obj/main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [main] Error 1
Run Code Online (Sandbox Code Playgroud)
命令行:make ARCH = arm CROSS_COMPILE = arm-none-linux-gnueabi-l
Makefile :(更新)
export ARCH:=arm
export CROSS_COMPILE:=arm-none-linux-gnueabi
IDIR =./
CC=arm-linux-gnueabi-gcc
CFLAGS=-I$(IDIR)
LD= //opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/
ODIR=obj
LDIR =./
LIBS=-lgd -lrt
_DEPS = main.h Makefile
DEPS …Run Code Online (Sandbox Code Playgroud) 我希望有一个触发器可以在事件发生时停止计算得分,
function restartStopScore()
score = score + 0
end
Run Code Online (Sandbox Code Playgroud)
不管用
score = 0
local scoreText = display.newText( "Score: " .. score, 20, 20,nil, 40)
scoreText:setTextColor(255,255,255)
local function getScore() -- increments Speed value every time it is called
score = score + 1
scoreText.text = "Score: " .. score
print("score" .. score)
end
timer.performWithDelay(1000, getScore, 0)
function restartScore()
--reset the score
score = 0
end
timer.performWithDelay(5000, restartScore, 1)--test trigger reset the score
Run Code Online (Sandbox Code Playgroud)