makefile与交叉编译环境
Makefile文件
obj=main.o buf_send.o tcp_bind.o hua_cheng.o doit_pthread.o shang_chuan.o \
time_jiaodui.o changee.o\
dianchi_stop.o dianchi_suspend.o dianchi_regain.o power_down_recover_or_cl
ean.o\
changeIP.o alarmLed_control.o google.o time_test.o pthread_fun.o
target=main
#cc=gcc
cc= arm-none-linux-gnueabi-
C=-g
LP=-lpthread
$(target):$(obj)
$(cc)gcc $(C) $(LP) $^ -o $@
clean:
rm -rf *.o main
make时出错:
cc -c -o main.o main.c
cc -c -o buf_send.o buf_send.c
cc -c -o tcp_bind.o tcp_bind.c
cc -c -o hua_cheng.o hua_cheng.c
cc -c -o doit_pthread.o doit_pthread.c
doit_pthread.c: In function ‘doit_pthread’:
doit_pthread.c:100: warning: passing argument 3 of ‘pthread_create’ from incompa
tible pointer type
cc -c -o shang_chuan.o shang_chuan.c
cc -c -o time_jiaodui.o time_jiaodui.c
cc -c -o changee.o changee.c
cc -c -o dianchi_stop.o dianchi_stop.c
cc -c -o dianchi_suspend.o dianchi_suspend.c
cc -c -o dianchi_regain.o dianchi_regain.c
cc -c -o power_down_recover_or_clean.o power_down_recover_or_clean.c
cc -c -o changeIP.o changeIP.c
cc -c -o alarmLed_control.o alarmLed_control.c
cc -c -o google.o google.c
cc -c -o time_test.o time_test.c
cc -c -o pthread_fun.o pthread_fun.c
arm-none-linux-gnueabi-gcc -g -lpthread main.o buf_send.o tcp_bind.o hua_cheng.o
doit_pthread.o shang_chuan.o time_jiaodui.o changee.o dianchi_stop.o dianchi_su
spend.o dianchi_regain.o power_down_recover_or_clean.o changeIP.o alarmLed_contr
ol.o google.o time_test.o pthread_fun.o -o main
/root/softback/arm-2007q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.0/../../../.
./arm-none-linux-gnueabi/bin/ld: main.o: Relocations in generic ELF (EM: 3)
main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [main] E"
我没有用交叉编译是,make是没有错误的。
我单独用arm-none-linux-gnueabi-gcc 编译单个文件时也没有错误。
希望大家帮帮忙,给我指点一下迷津。
在此感谢大家了。
obj=main.o buf_send.o tcp_bind.o hua_cheng.o doit_pthread.o shang_chuan.o \
time_jiaodui.o changee.o\
dianchi_stop.o dianchi_suspend.o dianchi_regain.o power_down_recover_or_cl
ean.o\
changeIP.o alarmLed_control.o google.o time_test.o pthread_fun.o
target=main
#cc=gcc
cc= arm-none-linux-gnueabi-
C=-g
LP=-lpthread
$(target):$(obj)
$(cc)gcc $(C) $(LP) $^ -o $@
clean:
rm -rf *.o main
make时出错:
cc -c -o main.o main.c
cc -c -o buf_send.o buf_send.c
cc -c -o tcp_bind.o tcp_bind.c
cc -c -o hua_cheng.o hua_cheng.c
cc -c -o doit_pthread.o doit_pthread.c
doit_pthread.c: In function ‘doit_pthread’:
doit_pthread.c:100: warning: passing argument 3 of ‘pthread_create’ from incompa
tible pointer type
cc -c -o shang_chuan.o shang_chuan.c
cc -c -o time_jiaodui.o time_jiaodui.c
cc -c -o changee.o changee.c
cc -c -o dianchi_stop.o dianchi_stop.c
cc -c -o dianchi_suspend.o dianchi_suspend.c
cc -c -o dianchi_regain.o dianchi_regain.c
cc -c -o power_down_recover_or_clean.o power_down_recover_or_clean.c
cc -c -o changeIP.o changeIP.c
cc -c -o alarmLed_control.o alarmLed_control.c
cc -c -o google.o google.c
cc -c -o time_test.o time_test.c
cc -c -o pthread_fun.o pthread_fun.c
arm-none-linux-gnueabi-gcc -g -lpthread main.o buf_send.o tcp_bind.o hua_cheng.o
doit_pthread.o shang_chuan.o time_jiaodui.o changee.o dianchi_stop.o dianchi_su
spend.o dianchi_regain.o power_down_recover_or_clean.o changeIP.o alarmLed_contr
ol.o google.o time_test.o pthread_fun.o -o main
/root/softback/arm-2007q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.0/../../../.
./arm-none-linux-gnueabi/bin/ld: main.o: Relocations in generic ELF (EM: 3)
main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [main] E"
我没有用交叉编译是,make是没有错误的。
我单独用arm-none-linux-gnueabi-gcc 编译单个文件时也没有错误。
希望大家帮帮忙,给我指点一下迷津。
在此感谢大家了。
...全文
相关推荐
nfs交叉编译环境的构建和注意点 ppt
**什么是交叉编译?** 它是指在一台主机(宿主机)上运行的编译器生成可以在目标机上运行的代码。在嵌入式开发中,由于目标系统的硬件和软件环境与宿主机不同,因此需要交叉编译工具链。
paho.mqtt交叉编译arm
**修改Makefile**:"makefile已经移植好的"表明`paho.mqtt.c-master`源码中的Makefile已经过适应性修改,可以支持ARM交叉编译。
mips平台gstreamer交叉编译
配置环境变量:**安装好交叉编译工具链后,需要设置环境变量,如`CC`、`CXX`、`AR`、`RANLIB`等,以指示编译器和链接器使用正确的版本。
linux平台下Eclipse配置交叉编译环境
配置交叉编译环境的重要性:在 Linux 平台下使用 Eclipse 进行嵌入式 C 开发时,需要配置交叉编译环境。交叉编译环境是指在一个平台上编译的代码可以在另一个平台上运行的环境。
Linux-基础入门-学习笔记(2):交叉编译工具链与Makefile
“Linux-基础入门-学习笔记(2):交叉编译工具链与Makefile”这篇学习笔记主要介绍了Linux环境下的交叉编译工具链以及Makefile的基础知识,适用于初学者。在深入探讨这两个主题之


