当前位置: 技术问答>linux和unix
运行rtlinux程序时出现的问题(主要是加载.so库时)
来源: 互联网 发布时间:2016-03-18
本文导语: 运行rtlinux程序时出现的问题(主要是加载.so库时) 由于要做自己的课题,最近一直在用rtlinux编程,但是一直出现一个问题,不知道该怎么解决,很郁闷!希望有人指点。 主要问题如下:写完自己的源文件后,在写ma...
运行rtlinux程序时出现的问题(主要是加载.so库时)
由于要做自己的课题,最近一直在用rtlinux编程,但是一直出现一个问题,不知道该怎么解决,很郁闷!希望有人指点。
主要问题如下:写完自己的源文件后,在写makefile文件时板卡自带的链接库加不进去,make的时候终端中这样显示:
[root@localhost rtlinuxhong]# make
gcc -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -O2 -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/pci-dask_413/include -I/usr/src/rtlinux-3.2-pre3/include/posix -c -o injection.o injection.c -lm -lpci_dask
gcc: -lm: linker input file unused because linking not done
gcc: -lpci_dask: linker input file unused because linking not done
每次在insmod aa.o(aa
为模块的名字)都会出现下面的语句:
[root@localhost rtlinuxhong]# insmod injection.o
injection.o: unresolved symbol Release_Card
injection.o: unresolved symbol Register_Card
injection.o: unresolved symbol DO_WriteLine
injection.o: unresolved symbol DI_ReadLine
injection.o:
Hint: You are trying to load a module without a GPL compatible license
and it has unresolved symbols. Contact the module supplier for
assistance, only they can help you.
其中的Release_Card,Register_Card,DO_WriteLine和DI_ReadLine都是数据采集卡自带函数,这里出现unresolved symbol ,主要是由于加载链接库-lpci_dask时linker input file unused because linking not done (个人认为是这个样子的),但是实在不知道该怎么样才能正确加载进去,希望高人指点,不胜感激!!!下面是我自己的makefile的内容:
#Automatically generated by RTLinux Makefile
all:injection.o
RTL_DIR = /usr/src/rtlinux-3.2-pre3
RTLINUX_DIR = /usr/src/rtlinux-3.2-pre3/linux
INCLUDE= -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat
CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -O2 -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/pci-dask_413/include -I/usr/src/rtlinux-3.2-pre3/include/posix
ARCH = i386
CC = gcc
CXXFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/rtlinux-3.2-pre3/include/posix -fno-exceptions -fno-rtti
clean:
rm -f *.o
injection.o:injection.c
$(CC) ${CFLAGS} -c -o injection.o injection.c -lm -lpci_dask
include $(RTL_DIR)/Rules.make
希望您的指点!
由于要做自己的课题,最近一直在用rtlinux编程,但是一直出现一个问题,不知道该怎么解决,很郁闷!希望有人指点。
主要问题如下:写完自己的源文件后,在写makefile文件时板卡自带的链接库加不进去,make的时候终端中这样显示:
[root@localhost rtlinuxhong]# make
gcc -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -O2 -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/pci-dask_413/include -I/usr/src/rtlinux-3.2-pre3/include/posix -c -o injection.o injection.c -lm -lpci_dask
gcc: -lm: linker input file unused because linking not done
gcc: -lpci_dask: linker input file unused because linking not done
每次在insmod aa.o(aa
为模块的名字)都会出现下面的语句:
[root@localhost rtlinuxhong]# insmod injection.o
injection.o: unresolved symbol Release_Card
injection.o: unresolved symbol Register_Card
injection.o: unresolved symbol DO_WriteLine
injection.o: unresolved symbol DI_ReadLine
injection.o:
Hint: You are trying to load a module without a GPL compatible license
and it has unresolved symbols. Contact the module supplier for
assistance, only they can help you.
其中的Release_Card,Register_Card,DO_WriteLine和DI_ReadLine都是数据采集卡自带函数,这里出现unresolved symbol ,主要是由于加载链接库-lpci_dask时linker input file unused because linking not done (个人认为是这个样子的),但是实在不知道该怎么样才能正确加载进去,希望高人指点,不胜感激!!!下面是我自己的makefile的内容:
#Automatically generated by RTLinux Makefile
all:injection.o
RTL_DIR = /usr/src/rtlinux-3.2-pre3
RTLINUX_DIR = /usr/src/rtlinux-3.2-pre3/linux
INCLUDE= -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat
CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -O2 -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/pci-dask_413/include -I/usr/src/rtlinux-3.2-pre3/include/posix
ARCH = i386
CC = gcc
CXXFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/rtlinux-3.2-pre3/linux/include/linux/modversions.h -g -D__RTL__ -D_LOOSE_KERNEL_NAMES -I/usr/src/rtlinux-3.2-pre3/linux/include -I/usr/src/rtlinux-3.2-pre3/include -I/usr/src/rtlinux-3.2-pre3/include/compat -I/usr/src/rtlinux-3.2-pre3/include/posix -fno-exceptions -fno-rtti
clean:
rm -f *.o
injection.o:injection.c
$(CC) ${CFLAGS} -c -o injection.o injection.c -lm -lpci_dask
include $(RTL_DIR)/Rules.make
希望您的指点!
|
RPWT..