-1

我刚开始使用“HELLO WORLD”程序启动 ACE。它编译成功,但是在构建时会产生一些错误。谁能帮助我。代码:

#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;
}

错误:

/tmp/cccwdbA0.o:在函数“main”中:hello.cpp:(.text+0xa):未定义引用 `ACE_Log_Msg::last_error_adapter()'
hello.cpp:(.text+0x13):未定义引用` ACE_Log_Msg::instance()'
hello.cpp:(.text+0x43): undefined reference to 'ACE_Log_Msg::conditional_set(char const*, int, int, int)'
hello.cpp:(.text+0x5f): undefined引用 `ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
collect2: ld returned 1 exit status
编译失败。

4

2 回答 2

0

没有看到构建命令很难说,但看起来您没有添加对 ACE 库的链接时引用。

于 2010-08-19T15:51:18.967 回答
0

很难说你做了什么让这不起作用。如果我猜的话,看起来好像您已经更新了 makefile 中的包含路径,但忘记将 libACE.so 链接到您的项目。这将导致您看到未定义的编译行为。

于 2013-01-06T14:42:17.890 回答