在尝试交叉编译一个程序一个星期之后,我放弃了,现在我试图在运行qtopia 2.2.0的友好手臂上直接编译它,但是当我运行make时,我遇到了一些奇怪的错误。有人能给我更多的启示吗?也许能为我指出解决问题的正确方向吗?
制造输出:
/sdcard/images/makef # make
make: Warning: File `Makefile' has modification time 2.2e+04 s in the future
gcc -c -o obj/main.o main.c -I./
gcc -c -o obj/serial.o serial.c -I./
gcc -c -o obj/fb.o fb.c -I./
gcc -c -o obj/menu_main.o menu_main.c -I./
gcc -c -o obj/timer.o timer.c -I./
gcc -c -o obj/cmdin.o cmdin.c -I./
cmdin.c: In function 'processcmd':
cmdin.c:64: warning: format '%f' expects type 'float *', but argument 4 has type 'int *'
gcc -c -o obj/buzzer.o buzzer.c -I./
gcc -c -o obj/statemachine.o statemachine.c -I./
gcc -c -o obj/inout.o inout.c -I./
gcc -c -o obj/network.o network.c -I./
gcc -c -o obj/text_file_input.o text_file_input.c -I./
gcc -c -o obj/text_file_input_oven.o text_file_input_oven.c -I./
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: skipping incompatible /usr/lib/gcc/arm-linux-gnueabi/4.4.1/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/gcc/arm-linux-gnueabi/4.4.1/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/gcc/arm-linux-gnueabi/4.4.1/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/gcc/arm-linux-gnueabi/4.4.1/librt.a when searching for -lrt
/usr/lib/gcc/arm-linux-gnueabi/4.4.1/../../../librt.a(timer_create.o): In function `timer_create':
timer_create.c:(.text+0xd4): undefined reference to `pthread_once'
/usr/lib/gcc/arm-linux-gnueabi/4.4.1/../../../librt.a(timer_routines.o): In function `timer_helper_thread':
timer_routines.c:(.text+0xfc): undefined reference to `pthread_create'
/usr/lib/gcc/arm-linux-gnueabi/4.4.1/../../../librt.a(timer_routines.o): In function `__start_helper_thread':
timer_routines.c:(.text+0x1a0): undefined reference to `pthread_attr_setstacksize'
timer_routines.c:(.text+0x1e4): undefined reference to `pthread_create'
timer_routines.c:(.text+0x228): undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status
make: *** [main] Error 1
/sdcard/images/makef # 另外,如果这条消息:make:警告:文件‘`Makefile’有修改时间2.2e+04在以后的中,我如何获得?
touch *.*但这并没有帮助
发布于 2014-04-25 18:49:07
警告:未来文件“`Makefile”的修改时间为2.2e+04
您正在编译的系统上的时钟和生成文件的系统不同步。您应该解决这个问题(在另一个答案中提到了使用touch解决方案),但如果“其他计算机”运行的时间不对--如果您正在编译的系统运行的时间是错误的,那么您应该在当前系统上确定时间--最好是使用ntp (网络时间协议)在启动时或类似的网络源上设置您的时间--这样,您就不必担心它们会脱离阶段,因为PC系统时钟在一个月内会在1到30秒之间漂移,这取决于实际使用的硬件。
/usr/bin/ld:跳过不兼容的/usr/lib/gcc/arm gnueabi/4.4.1/labt.so搜索-lrt
这些消息是无害的,只要系统能够找到一些“兼容”的库,而且似乎是这样的,因为我们得到了这些信息。
/usr/lib/gcc/arm-linux-gnueabi/4.4.1/../../../librt.a(timer_routines.o)
下面指出libp线程没有被链接(在正确的位置)
timer_create.c:(.text+0xd4):对`pthread_once的未定义引用
您需要在链接器行中使用-lpthread --在-lrt之后,因为librt是使用p线程函数的工具。请注意,库对顺序很敏感(有时甚至需要给同一个库两次,因为存在循环依赖关系)
发布于 2014-04-25 18:16:46
该消息通常表示您的一些文件的修改时间比当前的系统时间晚。一种可能的解决方案是“触摸”源树中的每个文件,以便更新时间戳:转到子树的根和do“查找. -exec触摸{} \;”
然后清理项目,删除所有构建文件并重试编译。
您似乎也忘记了链接libp线程。您应该拥有posix库,并将项目链接到libp线程。
https://stackoverflow.com/questions/23297283
复制相似问题