2010-06-02 72 views
-1

我刚刚开始使用“HELLO WORLD”程序的ACE。它编译成功,但在构建它时会产生一些错误。任何人都可以帮助我。 CODE:构建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: In function `main': hello.cpp:(.text+0xa): undefined reference to `ACE_Log_Msg::last_error_adapter()'
hello.cpp:(.text+0x13): undefined reference to `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 reference to `ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
collect2: ld returned 1 exit status
Compilation failed.

回答

0

在没有看到构建命令很难说,但它看起来像你没有添加链接时参考ACE库。

0

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

相关问题