-1

i just started ACE with a "HELLO WORLD" program. It compiled successfully but while building it produces some of the errors.Can anyone help me. CODE:

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

ERROR:

/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.

Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74
karthi
  • 1
  • 1

2 Answers2

0

It's hard to tell what you've done to make this not work. If I were to guess, it looks as if you've updated your include path in your makefile but forgotten to link libACE.so to your project. This would result in the undefined compilation behaviour you're seeing.

Tyler Jandreau
  • 4,245
  • 1
  • 22
  • 47
0

Without seeing the build commands it's hard to tell but it looks like you didn't add a link-time reference to the ACE library.

Steve Huston
  • 1,432
  • 13
  • 20