partysip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Partysip-dev] loggin problem in win32


From: Zihong Lu
Subject: Re: [Partysip-dev] loggin problem in win32
Date: Wed, 29 Jan 2003 23:06:40 -0800 (PST)

Finally get some time to test it out.  All I changed
was using "debug multithreaded DLL" for C/C++ code
generation, for osipfsm.dll, osipparser.dll, and all
the projects in partysip, I kept the default libraries
in the link settings without change.  And it worked
now.  

Still don't know why using "debug multithreaded" for
osipfsm.dll, osipparser.dll, and all the projects in
partysip did not work.  Vaguely remember I had
encountered similar situation in VC5 before.

This list is the default VC++ loaded libraries:
Multithreaded           /MT  libcmt.lib
Multithreaded DLL       /MD  msvcrt.lib  (msvcrt.dll)
Debug Multithreaded     /MTd libcmtd.lib
Debug Multithreaded DLL /MDd msvcrtd.lib (msvcrt.dll)


No change to the underscored function calls is
necessary.  The reason I prefer the no underscore
function calls is that the ones without the underscore
are ANSI C compatible, please see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt_compatibility.asp
for detail.



-Zihong

--- Aymeric Moizard <address@hidden> wrote:
> 
> 
> On Wed, 29 Jan 2003, Zihong Lu wrote:
> 
> > Aymeric and Donovan,
> >
> > Thanks for your replies.  Just digged into MSDN,
> this
> > is what I have found:
> > (1) debug multithreaded DLL is a DLL, debug
> > multithreaded is a static lib.  I suspect that
> when I
> > compiled partysip.exe, it was linked to a
> different
> > version of the multithreaded lib than the lib
> linked
> > in osipfsm.dll and osipparser.dll, so caused the
> > problem;
> 
> Ok, but if I specify "debug multithreaded", why do
> I still link with another library? By selecting
> this,
> I was expecting that the compilation will use the
> correct version. Anyway, I don't speak VC++.
> 
> > (2) There should not be necessary to change
> stricmp to
> > _stricmp and strnicmp to _strnicmp, they should
> behave
> > the same;
> 
> The msdn doc says that this is the ANSI version so I
> prefer
> this one. Also it's not contained in msvcrtd.lib
> which is
> 
> If I keep stricmp, I can't link with only
> msvcrtd.lib. This
> is why using _stricmp might be better. Did I miss
> any advantage
> of using stricmp without underscore?
> 
> Aymeric
> 
> > -Zihong
> >
> >
> >
> > --- Donovan Bruce <address@hidden> wrote:
> > > I think there is an easier way without wholesale
> > > changes
> > > to osip. Here is what I had to do to make file
> > > logging work for me
> > > (my environment is Windows NT). The changes
> below
> > > also eliminated
> > > what I consider to be a nuisance logging of data
> > > when there
> > > is no input traffic.
> > >
> > > The following changes were applied to
> libosip-0.9.3:
> > > (look for the initials DAB or /* DAB */to see my
> > > changes)
> > >
> > > 1) modify  port_misc.c and port.h from
> > > oSIP-0.9.0/libosip-0.x.x/parser and
> > >    oSIP-0.9.0/libosip-0.x.x/osip respectively as
> > > follows:
> > >
> > >
> > > Port_misc.c mod:
> > > ----------------
> > >
> > > #if defined(HAVE_STDARG_H) ||
> > > defined(__VXWORKS_OS__) || defined(WIN32) ||
> > > defined(_WIN32_WCE)
> > > osip_trace (char *fi, int li, trace_level_t
> level,
> > > FILE * fp/* f becomes fp DAB */, char
> > > *chfr, ...)
> > > #else
> > > osip_trace (fi, li, level, fp/* f becomes fp DAB
> */,
> > > chfr, va_list)
> > >      char *fi;
> > >      char *li;
> > >      int level;
> > >      FILE *fp/* f becomes fp DAB */;
> > >      char *chfr
> > > #endif
> > >      {
> > >        va_list ap;
> > >      FILE *f /* new f DAB */;
> > >
> > > #ifdef ENABLE_TRACE
> > >
> > > #if !defined(WIN32) &&
> > > !defined(SYSTEM_LOGGER_ENABLED)
> > >        if (logfile == NULL)
> > >    {                      /* user did not initialize logger.. */
> > >      return 1;
> > >    }
> > > #endif
> > >
> > >        if (fp == NULL) /* f becomes fp DAB */
> > >              f = logfile==NULL ? stdout : logfile; /*
> DAB */
> > >      else  /* DAB */
> > >            f = fp; /* DAB */
> > >
> > >
> > >
> > > port.h mod:
> > > ----------
> > >    int
> > > #if defined(HAVE_STDARG_H) || defined(WIN32) ||
> > > defined(__VXWORKS_OS__)
> > >
> > >     osip_trace (char *fi, int li, trace_level_t
> > > level, FILE * fp/* f becomes fp DAB */,
> > > char *chfr,
> > >           ...);
> > > #else
> > > /* ERROR? I never tested this */
> > >     osip_trace (fi, li, level, fp/* f becomes fp
> DAB
> > > */, chfr, va_list);
> > > #endif
> > >
> > > 2) modify  file:  libosip-0.x.x/fsm/port_fifo.c
> to :
> > >
> > > void *
> > > fifo_tryget (fifo_t * ff)
> > > {
> > >   void *el;
> > >   int rc; /* DAB */
> > > #ifdef OSIP_MT
> > >   if (0 > (rc = ssem_trywait (ff->qisempty)) ||
> > > rc==EBUSY /* DAB */)
> > >     {                           /* no
> elements... */
> > >       return NULL;
> > >     }
> > >
> > >
> > >
> > >
> >
>
/******************************************************
> > >   This step 2) change eliminates the printing of
> a
> > > nusiance
> > >   message when there is no input traffic to
> process.
> > > !!!
> > >
> > >
> >
>
******************************************************/
> > >
> > >
> > >
> >
>
/********************************************************************
> > >   And this is what I had to do to VC++ to ensure
> > > correct logging
> > >   operation for our mutithreaded app.
> > >
> > >
> >
>
/********************************************************************
> > >
> > > 3)  set vc++ c++ compiler "code generation"
> settings
> > > to
> > >     "debug multithreaded dll" for all projects
> > >     do for both libosip-0.x.x and partysip-0.x.x
> > > compilations.
> > >
> > > 4)  modify vc++ linker options to add msvcrt.lib
> in
> > > the
> > >     General "object/library modules" line for
> all
> > > projects
> > >     do for both libosip-0.x.x and partysip-0.x.x
> > > compilations.
> > >
> > > 5)  modify vc++ linker options "output" pane to
> > > ignore libcmtd.lib in
> > >     "ignore libraries" line for all projects. Do
> for
> > > both libosip-0.x.x
> > >     and partysip-0.x.x compilations.
> > >
> > > 6)  compile osipfsm.dll amd osipparser.dll  from
> > >     libosip.x.x/windows vc++ project files.
> > >
> > > 7)  compile partysip in batch mode. Do rebuild
> all
> 
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]