本版版主招募中

 
标题: 关于在Solaris 10上 gcc编译的问题(请大家帮忙,谢谢)
xingyu820424 (Maksim)
LU幼天使
Rank: 2


UID 36819
精华 0
积分 51
帖子 93
活跃指数 16
LU金币 2115 个
LU金条 0 个
阅读权限 20
注册 2005-11-21
 
发表于 2007-8-28 08:12  资料  个人空间  短消息  加为好友 
关于在Solaris 10上 gcc编译的问题(请大家帮忙,谢谢)

在Solaris10上自带gcc 3.4.3,
我有一个程序 appsnd6, 有自己的头文件和库文件(libapp.a)
用的用户是app用户, SHELL=/bin/sh
开始:
gcc -I/home/app/h -c appsnd6.c   能够生成appsnd6.o文件,没有问题
但在进行 ld -L/home/app/obj -lapp -o appsnd6 appsnd6.o的时候 报以下错误:
Undefined                       first referenced
symbol                             in file
exit                                appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
free                                appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
puts                                appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
stat                                appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
time                                appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
errno                               appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
fread                               appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
mkdir                               appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
app_defval                        appsnd6.o
closedir                            appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
app_stop                          appsnd6.o
app_init                          appsnd6.o
app_open                          appsnd6.o
Ctl_tr                              appsnd6.o
set_format                          appsnd6.o
opendir                             appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
fclose                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
fflush                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
getenv                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
fwrite                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
remove                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strcat                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strcmp                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strcpy                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strdup                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strlen                              appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
realloc                             appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
localtime                           appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
app_rcv                           appsnd6.o
app_snd                           appsnd6.o
strncpy                             appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
tr_pdmp                             appsnd6.o
tr_pmsg                             appsnd6.o
strerror                            appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
strftime                            appsnd6.o  (symbol belongs to implicit dependency /usr/lib/libc.so.1)
app_close                         appsnd6.o
app_abort                         appsnd6.o
ld: fatal: Symbol referencing errors. No output written to appsnd6

如果我直接使用gcc -I/home/app/h -L/home/app/obj -lapp -o appsnd6 appsnd6.c命令,则以下报错信息:
Undefined                       first referenced
symbol                             in file
app_defval                        /var/tmp//cckoW6Yo.o
app_stop                          /var/tmp//cckoW6Yo.o
app_init                          /var/tmp//cckoW6Yo.o
app_open                          /var/tmp//cckoW6Yo.o
Ctl_tr                              /var/tmp//cckoW6Yo.o
set_format                          /var/tmp//cckoW6Yo.o
app_rcv                           /var/tmp//cckoW6Yo.o
app_snd                           /var/tmp//cckoW6Yo.o
tr_pdmp                             /var/tmp//cckoW6Yo.o
tr_pmsg                             /var/tmp//cckoW6Yo.o
app_close                         /var/tmp//cckoW6Yo.o
app_abort                         /var/tmp//cckoW6Yo.o
ld: fatal: Symbol referencing errors. No output written to appsnd6
collect2: ld returned 1 exit status

应该是连接库的时候,有问题,希望大家帮忙,本人万分感谢,已经想了很多办法折腾了4天了.都没解决.





我是新手,谁怕谁啊
顶部
xingyu820424 (Maksim)
LU幼天使
Rank: 2


UID 36819
精华 0
积分 51
帖子 93
活跃指数 16
LU金币 2115 个
LU金条 0 个
阅读权限 20
注册 2005-11-21
 
发表于 2007-8-28 09:45  资料  个人空间  短消息  加为好友 
后来又下载了一个GCC 3.4.6 for solaris 10,安装上去,设置PATH 为新安装的GCC 目录下(/usr/local/bin)
也同样遇见以上的问题





我是新手,谁怕谁啊
顶部
xingyu820424 (Maksim)
LU幼天使
Rank: 2


UID 36819
精华 0
积分 51
帖子 93
活跃指数 16
LU金币 2115 个
LU金条 0 个
阅读权限 20
注册 2005-11-21
 
发表于 2007-8-28 14:39  资料  个人空间  短消息  加为好友 
问题解决了,呵呵





我是新手,谁怕谁啊
顶部
 



当前时区 GMT+8, 现在时间是 2008-9-5 15:41
乐悠LoveUnix论坛-京ICP备05005823号

Thanks to Discuz!  © 2001-2007    Power by LoveUnix.net
Processed in 0.051972 second(s), 6 queries , Gzip enabled

清除 Cookies - 联系我们 - 乐悠LoveUnix - Archiver