GodPig 发表于 2008-12-24 19:52:38

编译Hello World出现的问题

系统为:redhat
编译命令为: g++ -g -Wall -I $ACE_ROOT hello.cpp
出现的错误信息为:

/tmp/cck4BAzE.o(.text+0x1d): In function `main':
/home/godpig/Desktop/work/ace/hello.cpp:7: undefined reference to `ACE_Log_Msg::last_error_adapter()'
/tmp/cck4BAzE.o(.text+0x25):/home/godpig/Desktop/work/ace/hello.cpp:7: undefined reference to `ACE_Log_Msg::instance()'
/tmp/cck4BAzE.o(.text+0x3f):/home/godpig/Desktop/work/ace/hello.cpp:7: undefined reference to `ACE_Log_Msg::conditional_set(char const*, int, int, int)'
/tmp/cck4BAzE.o(.text+0x54):/home/godpig/Desktop/work/ace/hello.cpp:7: undefined reference to `ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
collect2: ld returned 1 exit status


hello.cpp的代码为:

#include <stdio.h>
#include "ace/Log_Msg.h"
#include "ace/OS_main.h"
int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
      ACE_DEBUG((LM_DEBUG, "Hello World\n"));
      return 0;
}



我初学,从网上找了个最简单的例子,但一编译就出现了这样的问题,不知道是什么原因造成的?
非常感谢!!!

GodPig 发表于 2008-12-24 20:44:31

已经解决了,原来是没有加上库的原因
页: [1]
查看完整版本: 编译Hello World出现的问题