Logger Example

  • Thread starter solanki.chandrakant
  • Start date
S

solanki.chandrakant

Hi

I have downloaded install ACE 5.6.6

Installation Step

01] cd /usr/src/ACE_wrappers
02] mkdir objdir
03] cd objdir
04] ../configure
05] make && make install
06] export ACE_ROOT=/usr/src/ACE_wrappers
07] export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace
08] cd /usr/src/ACE_wrappers/ace
09] ln-s config-linux.h config.h
10] ln -s platform_linux.GNU platform_macros.GNU ln-s
platform_linux.GNU platform_macros.GNU

Then I have return simple program.. named "client.cpp"

#include "/usr/src/ACE_wrappers/ace/Log_Msg.h"

void foo(void);

int ACE_TMAIN (int, ACE_TCHAR *[])
{
ACE_TRACE (ACE_TEXT ("main"));
ACE_LOG_MSG->priority_mask (LM_DEBUG | LM_NOTICE,
ACE_Log_Msg::pROCESS);

ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHi Mom\n")));
foo ();
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%IGoodnight\n")));

return 0;
}

void foo(void)
{
ACE_TRACE (ACE_TEXT ("foo"));
ACE_DEBUG ((LM_NOTICE, ACE_TEXT ("%IHowdy Pardner\n")));
}
================================================================================
Makefile for client.cpp

BIN = client
BUILD = $(VBIN)
SRC = $(addsuffix .cpp,$(BIN))
VLDLIBS = $(LDLIBS:%=%$(VAR))

#----------------------------------------------------------------------------
# Include macros and targets
#----------------------------------------------------------------------------

include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
================================================================================

After all I have fire the make / make client command from terminal it
gives me error like

GNUmakefile: /usr/src/ACE_wrappers/MYProg/GNUmakefile MAKEFLAGS=

g++ -fvisibility=hidden -fvisibility-inlines-hidden -W -Wall -Wpointer-
arith -O3 -ggdb -pipe -D_REENTRANT -DACE_HAS_AIO_CALLS -
D_GNU_SOURCE -I/usr/src/ACE_wrappers -DACE_HAS_EXCEPTIONS -
D__ACE_INLINE__ -c -o .obj/client.o client.cpp
g++ -fvisibility=hidden -fvisibility-inlines-hidden -W -Wall -Wpointer-
arith -O3 -ggdb -pipe -D_REENTRANT -DACE_HAS_AIO_CALLS -
D_GNU_SOURCE -I/usr/src/ACE_wrappers -DACE_HAS_EXCEPTIONS -
D__ACE_INLINE__ -Wl,-E -L/usr/src/ACE_wrappers/ace -L./ -L/usr/src/
ACE_wrappers/lib -o client .obj/client.o -ldl -lpthread -lrt
..obj/client.o: In function `foo':
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::last_error_adapter()'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::instance()'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::conditional_set(char const*, int, int, int)'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
..obj/client.o: In function `main':
/usr/src/ACE_wrappers/MYProg/client.cpp:9: undefined reference to
`ACE_Log_Msg::instance()'
/usr/src/ACE_wrappers/MYProg/client.cpp:9: undefined reference to
`ACE_Log_Msg::priority_mask(unsigned long, ACE_Log_Msg::MASK_TYPE)'
/usr/src/ACE_wrappers/MYProg/client.cpp:11: undefined reference to
`ACE_Log_Msg::last_error_adapter()'
/usr/src/ACE_wrappers/MYProg/client.cpp:11: undefined reference to
`ACE_Log_Msg::instance()'
/usr/src/ACE_wrappers/MYProg/client.cpp:11: undefined reference to
`ACE_Log_Msg::conditional_set(char const*, int, int, int)'
/usr/src/ACE_wrappers/MYProg/client.cpp:11: undefined reference to
`ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
..obj/client.o: In function `foo':
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::last_error_adapter()'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::instance()'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::conditional_set(char const*, int, int, int)'
/usr/src/ACE_wrappers/MYProg/client.cpp:21: undefined reference to
`ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'
..obj/client.o: In function `main':
/usr/src/ACE_wrappers/MYProg/client.cpp:13: undefined reference to
`ACE_Log_Msg::last_error_adapter()'
/usr/src/ACE_wrappers/MYProg/client.cpp:13: undefined reference to
`ACE_Log_Msg::instance()'
/usr/src/ACE_wrappers/MYProg/client.cpp:13: undefined reference to
`ACE_Log_Msg::conditional_set(char const*, int, int, int)'
/usr/src/ACE_wrappers/MYProg/client.cpp:13: undefined reference to
`ACE_Log_Msg::log(ACE_Log_Priority, char const*, ...)'


I am unable to predict the error..

help me out from above problem.

Thanks
 
M

Michael DOUBEZ

solanki.chandrakant a écrit :
I have downloaded install ACE 5.6.6

You are OT here.
Ask in a ACE group: comp.soft-sys.ace
Then I have return simple program.. named "client.cpp"

#include "/usr/src/ACE_wrappers/ace/Log_Msg.h"

This should not be. If your system is correctly configured
> [snip]
g++ ... -I/usr/src/ACE_wrappers ...

It seems to be properly configured regarding the header.
But there is no -lACE in the final link; it seems you are missing the
defines of platform_macros.GNU in your Makefile.

Please, ask on comp.soft-sys.ace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top