在redhat9.0下安装microwindows后,运行一个hello程序,链接共享库提示出错
hello.c
#include <stdio.h>
#include <microwin/nano-X.h>
...
编译
gcc -o hello hello.c -lnano-X
cannot find -lnona-X
collect2: ld returned 1 exit status
要链接的libnano-X库在 /home/micro-89/src/lib ,我把这个路径写到/etc/ld.so.conf 文件,并且用ldconfig刷新。结果还是出错。我又用
gcc -o hello hello.c -Lnano-X 将-lnano-X 的l 改为大写的L,提示为
/tmp/ccM5thZN.o(.text+0x11): In function `main':
: undefined reference to `GrOpen'
/tmp/ccM5thZN.o(.text+0x3a): In function `main':
: undefined reference to `GrNewGC'
/tmp/ccM5thZN.o(.text+0x52): In function `main':
: undefined reference to `GrSetGCForeground'
/tmp/ccM5thZN.o(.text+0x79): In function `main':
: undefined reference to `GrNewWindowEx'
/tmp/ccM5thZN.o(.text+0x94): In function `main':
: undefined reference to `GrSelectEvents'
/tmp/ccM5thZN.o(.text+0xa5): In function `main':
: undefined reference to `GrMapWindow'
/tmp/ccM5thZN.o(.text+0xb5): In function `main':
: undefined reference to `GrMainLoop'
/tmp/ccM5thZN.o(.text+0xf7): In function `event_handler':
: undefined reference to `GrText'
/tmp/ccM5thZN.o(.text+0x101): In function `event_handler':
: undefined reference to `GrClose'
collect2: ld returned 1 exit status
请大家指点,用大写L和小写l的区别,是否是链接库路径的方式不同?
问题点数:30、回复次数:2Top
1 楼wfwater(淡水)回复于 2005-04-06 09:37:13 得分 0
如果是在win2000 上用eclipse+CDT开发microwindows的程序,以后移植到ucLinux下。怎么做,我主要是指怎么配置microwindows,使程序能正确直接调用它的静态或者动态库,能够运行看到一些图形界面效果。在win2000上开发是因为上面暂时这样要求的。Top
2 楼yiyue(六月)回复于 2005-06-14 11:23:07 得分 30
我来up一下,看看有没有人给分Top




