找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 7836|回复: 2

AIX5.3编译一直报"ld:0711-317 错误:未定义的符号"

[复制链接]
发表于 2009-5-21 17:19:03 | 显示全部楼层 |阅读模式
AIX5.3系统上,编译一段很简单的代码,但是编译一直提示:
xlC_r -I/home/fjuvc/ACE/ACE_wrappers -g -q64    -c -o ACE_TEST.o ACE_TEST.cpp
xlC_r -I/home/fjuvc/ACE/ACE_wrappers -g -q64  -o ACE_TEST ACE_TEST.o -L/home/fjuvc/ACE/ACE_wrappers/lib -L/home/fjuvc/ACE/ACE_wrappers/ace -lACE
ld:0711-317 错误:未定义的符号:.ACE_Get_Opt::ACE_Get_Opt(int,char**,const char*,int,int,int,int)
ld:0711-317 错误:未定义的符号:.ACE_Log_Msg::last_error_adapter()
ld:0711-317 错误:未定义的符号:.ACE_Log_Msg::instance()
ld:0711-317 错误:未定义的符号:.ACE_Log_Msg::conditional_set(const char*,int,int,int)
ld:0711-317 错误:未定义的符号:.ACE_Log_Msg::log(ACE_Log_Priority,const char*,...)
ld:0711-317 错误:未定义的符号:.ACE_Get_Opt::operator()()
ld:0711-317 错误:未定义的符号:ACE_Addr::sap_any
ld:0711-317 错误:未定义的符号:.ACE_SOCK_Dgram_Bcast::ACE_SOCK_Dgram_Bcast(const ACE_Addr&,int,int,int,const char*)
ld:0711-317 错误:未定义的符号:.ACE_SOCK_Dgram_Bcast::send(const void*,unsigned long,unsigned short,int) const
ld:0711-317 错误:未定义的符号:.ACE_SOCK_Dgram_Bcast::~ACE_SOCK_Dgram_Bcast()
ld:0711-317 错误:未定义的符号:.ACE_Get_Opt::~ACE_Get_Opt()
ld:0711-345 使用 -bloadmap 或 -bnoquiet 选项获取详细信息。
gmake: *** [ACE_TEST] Error 8


我的Makefile文件也很简单:
CXX = xlC_r
CXXFLAGS = -I$(ACE_ROOT) -g -q64
OBJS =  ACE_TEST.o
LIBS =  -L$(ACE_ROOT)/lib -lACE
TARGET = ACE_TEST
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)


环境变量也已经配置好:
export ACE_ROOT=/home/fjuvc/ACE/ACE_wrappers
export LD_LIBRARY_PATH=$ACE_ROOT/lib:$ACE_ROOT/ace
export PATH=$ACE_ROOT/bin:$ACE_ROOT/lib:$ACE_ROOT/ace:/usr/local/include:/usr/include:/usr/vacpp/include:/usr/local/ssl/include:$PAT
H
AIX编译生成的是libACE.a

最后贴上代码,请帮帮忙:
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ace/OS.h>
  4. #include <ace/Get_Opt.h>
  5. #include <ace/SOCK_Dgram_Bcast.h>
  6. #include <ace/Addr.h>
  7. #include <ace/Log_Msg.h>
  8. int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
  9. {
  10. //Specify option string so that switches b, d, f and h all expect
  11. //arguments. Switches a, c, e and g expect no arguments.
  12. ACE_Get_Opt get_opt (argc, argv, "ab:cd:ef:gh:");
  13. int c;
  14. //Process the scanned options with the help of the overloaded ()
  15. //operator.
  16. while ((c = get_opt ()) != EOF)
  17.   switch (c)
  18.   {
  19.   case 'a':
  20.    ACE_DEBUG ((LM_DEBUG, "got a\n"));
  21.    break;
  22.   case 'b':
  23.    ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.optarg));
  24.    break;
  25.   case 'c':
  26.    ACE_DEBUG ((LM_DEBUG, "got c\n"));
  27.    break;
  28.   case 'd':
  29.    ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.optarg));
  30.    break;
  31.   case 'e':
  32.    ACE_DEBUG ((LM_DEBUG, "got e\n"));
  33.    break;
  34.   case 'f':
  35.    ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.optarg));
  36.    break;
  37.   case 'g':
  38.    ACE_DEBUG ((LM_DEBUG, "got g\n"));
  39.    break;
  40.   case 'h':
  41.    ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.optarg));
  42.    break;
  43.   default:
  44.    ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n",c));
  45.    break;
  46.   }
  47. //optind indicates how much of argv has been scanned so far, while
  48. //get_opt hasn"t returned EOF. In this case it indicates the index in
  49. //argv from where the option switches have been fully recognized and the
  50. //remaining elements must be scanned by the called himself.
  51. for (int i = get_opt.optind; i < argc; i++)
  52.   ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n", i, argv[i]));
  53. ACE_SOCK_Dgram_Bcast b_sap(ACE_Addr::sap_any);
  54. char *msg;
  55. unsigned short b_port;
  56. msg = argc > 1 ? argv[1] : "hello world\n";
  57. b_port = argc > 2 ? atoi (argv[2]) : 3702;
  58. if (b_sap.send (msg, strlen (msg), b_port) == -1)
  59. perror ("can’t send broadcast"), exit (1);
  60. getchar();
  61. return 0;
  62. }
复制代码
发表于 2009-5-21 19:33:19 | 显示全部楼层
用虚拟机,安装一个linux试试看什么情况。没用过AIX
 楼主| 发表于 2009-5-22 08:55:09 | 显示全部楼层

在linux没有问题

问题是项目需要部署在aix上,哪位有经验的帮忙看看
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-6 10:19 , Processed in 0.016421 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表