<div>Hi Steve,</div>  <div>&nbsp;</div>  <div>I read through C++NPv2 chapter5 and add several micros into my code:</div>  <div>&nbsp;</div>  <div>ACE_FACTORY_DEFINE(ACE_Local_Service, Logger</div>  <div>ACE_STATIC_SVC_DEFINE(</div>  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Logger_Descriptor,</div>  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_TEXT("Logger"),</div> 
 <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_SVC_OBJ_T,</div>  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;ACE_SVC_NAME(Logger),</div>  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,</div> 
 <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0)</div>  <div>ACE_STATIC_SVC_REQUIRE(Logger_Descriptor)</div>  <div>&nbsp;</div>  <div>all of the above micros are in file scope.</div>  <div>&nbsp;</div>  <div>before call open(...), I add </div>  <div>ACE_STATIC_SVC_REGISTER(Logger_Descriptor)</div>  <div>this micro is within class scope</div>  <div>&nbsp;</div>  <div>when I build my static lib, I set </div>  <div>enable-static=yes</div>  <div>enable-shared=no</div>  <div>enable-lib-all=yes</div>  <div>enable-lib-logging=yes</div>  <div>enable-logging=yes.</div>  <div>&nbsp;</div>  <div>when I compile my application, the following errors appear in order:</div>  <div>In function 'ACE_Service_Object * _make_Logger(..)</div>  <div>error: expected type-specifier before
 'Logger'</div>  <div>error: cannot convert 'int *' to 'ACE_Service_Object *' in return </div>  <div>error: expected ';'before 'Logger'</div>  <div>error: 'Logger' was not declared in this scope</div>  <div>&nbsp;</div>  <div>&nbsp;</div>  <div>It looks like I&nbsp;did not&nbsp;add Logger into the lib, I took a look at the configure file and no parameter is related to Logger directly.</div>  <div>&nbsp;</div>  <div>could you give me more information about it.</div>  <div>thank you very much.</div>  <div>&nbsp;</div>  <div>Richard</div>  <div>&nbsp;</div>  <div><BR><BR><B><I>Steve Huston &lt;shuston@riverace.com&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="MSHTML 6.00.6000.16544" name=GENERATOR>  <DIV><SPAN class=595205517-07122007><FONT face=Arial color=#0000ff size=2>Hi Richard,</FONT></SPAN></DIV>  <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>  <DIV><SPAN
 class=595205517-07122007><FONT face=Arial color=#0000ff size=2>Right... the Logger stuff is built into ACE when you build it as a shared library. When you build static, dynamic services inside of ACE (like Logger) won't be available. You may be able to add the static service information and allow the logging service to work as a static service when ACE is built as a static library.</FONT></SPAN></DIV>  <DIV><SPAN class=595205517-07122007><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>  <DIV><SPAN class=595205517-07122007><FONT face=Arial color=#0000ff size=2>C++NPv2 chapter 5 describes dynamic and static services. If you need further expertise with this project, please contact me to discuss it further.</FONT></SPAN></DIV>  <DIV><SPAN class=595205517-07122007><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>  <DIV><SPAN class=595205517-07122007><FONT face=Arial color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>  <DIV><SPAN
 class=595205517-07122007><FONT face=Arial color=#0000ff size=2>-Steve</FONT></SPAN></DIV><!-- Converted from text/plain format -->  <div><FONT size=2>--<BR>Steve Huston, Riverace Corporation<BR>Want to take ACE training on YOUR schedule?<BR>See <A href="http://www.riverace.com/training.htm">http://www.riverace.com/training.htm</A><BR></FONT></div>  <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">  <DIV></DIV>  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> richard zhao [mailto:rich4tech@yahoo.com] <BR><B>Sent:</B> Friday, December 07, 2007 11:19 AM<BR><B>To:</B> Steve Huston; ace-users@cs.wustl.edu<BR><B>Subject:</B> RE: [ace-users] question about runtime configuration with the ACELogging Strategy<BR><BR></FONT></DIV>  <DIV>Hello, Steve,</DIV>  <DIV>&nbsp;</DIV>  <DIV>thank you for your response.</DIV>  <DIV>in the application by
 using shared ACE lib. I did not write any code and did not define any class called Logger. I just&nbsp;put Logger after dynamic. do you think i need to&nbsp;write a class called Logger when I use static ACE lib.</DIV>  <DIV>&nbsp;</DIV>  <DIV>thanks</DIV>  <DIV>Richard<BR><BR><B><I>Steve Huston &lt;shuston@riverace.com&gt;</I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="MSHTML 6.00.6000.16544" name=GENERATOR>  <DIV><SPAN class=356090223-06122007><FONT face=Arial color=#0000ff size=2>Hi Richard,</FONT></SPAN></DIV>  <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>  <DIV><SPAN class=356090223-06122007><FONT face=Arial color=#0000ff size=2>Thanks for the PROBLEM-REPORT-FORM. I suspect you'll need to add the static service macros to ACE to set up the static service loading info. Please see C++NPv2 chapter 5 for details.</FONT></SPAN></DIV>  <DIV><SPAN
 class=356090223-06122007><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>  <DIV><SPAN class=356090223-06122007><FONT face=Arial color=#0000ff size=2>Best regards,</FONT></SPAN></DIV>  <DIV><SPAN class=356090223-06122007><FONT face=Arial color=#0000ff size=2>-Steve</FONT></SPAN></DIV><!-- Converted from text/plain format -->  <DIV><FONT size=2>--<BR>Steve Huston, Riverace Corporation<BR>Want to take ACE training on YOUR schedule?<BR>See <A href="http://www.riverace.com/training.htm">http://www.riverace.com/training.htm</A><BR></FONT></DIV>  <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">  <DIV></DIV>  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> ace-users-bounces@cse.wustl.edu [mailto:ace-users-bounces@cse.wustl.edu] <B>On Behalf Of </B>richard zhao<BR><B>Sent:</B> Thursday, December 06, 2007 5:33 PM<BR><B>To:</B>
 ace-users@cs.wustl.edu<BR><B>Subject:</B> [ace-users] question about runtime configuration with the ACELogging Strategy<BR><BR></FONT></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 14.4pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial">ACE VERSION: 5.6.1</SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 14.4pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial">HOST MACHINE and OPERATING SYSTEM:&nbsp; Intel PC,&nbsp;Linux enterprise 5.0</SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 14.4pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial"></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial">TARGET MACHINE and OPERATING SYSTEM: Same<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>  <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial; mso-fareast-font-family:
 SimSun; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">COMPILER NAME AND VERSION (AND PATCHLEVEL):<BR>G++<BR style="mso-special-character: line-break"></SPAN></DIV>  <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: #333333; FONT-FAMILY: Arial; mso-fareast-font-family: SimSun; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">I am writing a application by using ACE lib.<BR style="mso-special-character: line-break"></SPAN>I wrote a log application by using runtime configuration with the ACE logging strategy,</DIV>  <DIV>the input configuration&nbsp;file is like the following.</DIV>  <DIV>&nbsp;</DIV>  <DIV>dynamic Logger Service_Object * ACE:_make_ACE_Logging_Strategy() "-s log.out -f STDERR|OSTREAM - INFO"</DIV>  <DIV>&nbsp;</DIV>  <DIV>in the application file , I use the code segment:</DIV>  <DIV>if (ACE_Service_Config::open(argc,</DIV> 
 <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; argv,</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;ACE_DEFAULT_LOGGER_KEY,</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,</DIV> 
 <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) &lt; 0)</DIV>  <DIV>{</DIV>  <DIV>}</DIV>  <DIV>by this way, if I compile and link ACE to shared lib, it works well, I can create log.out and all message output to this log file.</DIV>  <DIV>&nbsp;</DIV>  <DIV>however, if I compile and link ACE to static lib, this way does not work, the log.out can not create. the error message is like the following:</DIV>  <DIV>1 ACE(28532|2142880) LN::open_dll_ failed to open ACE. error:
 check log for detail.</DIV>  <DIV>2. ACE(28532|2142880) unable to create service object for logger.</DIV>  <DIV>&nbsp;</DIV>  <DIV>I guess it is because no shared lib so I change the configuration file to the following.</DIV>  <DIV>&nbsp;</DIV>  <DIV>static Logger "-s log.out -f STDERR|OSTREAM -p INFO"</DIV>  <DIV>&nbsp;</DIV>  <DIV>then recompile and link my application which are using static ACE lib</DIV>  <DIV>the log.out still can not be created. </DIV>  <DIV>error mesasge is :</DIV>  <DIV>SG::initialize-service Logger was not located.</DIV>  <DIV>even I change the fourth parameter of open to 0.</DIV>  <DIV>&nbsp;</DIV>  <DIV>could someboby tell me some solutions of how to solve this problem. that is by using static ACE lib to create log application.</DIV>  <DIV>thanks in advance.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Richard</DIV>  <DIV>&nbsp;</DIV>  <DIV>  <HR SIZE=1>  Never miss a thing. <A href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs">Make Yahoo your
 homepage.</A> </DIV></BLOCKQUOTE></BLOCKQUOTE><BR>  <div>  <HR SIZE=1>  Never miss a thing. <A href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs">Make Yahoo your homepage.</A> </BLOCKQUOTE></BLOCKQUOTE><BR><p>&#32;
      <hr size=1>Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>