Re: Different C runtime libraries



SerGioGio wrote:
>
>
> I really see no reason at all. For example the debug and release CRT
> version should have exactly the same interface. Only be the
> implementation should differ, not the interface .h files! If my .LIB
> references "printf", the printf function to use should be the version
> of the CRT at link time. .LIB should be only seen as a bunch of .OBJ
> files put together. Why can't the world be so easy?

And if my lib creates a FILE * then passes it to your lib and your lib
passes it to fprintf which fprintf should be called? If it is yours it
cannot handle a FILE that has different members from what it expects. And my
mutlithreaded debug FILE will be very different from your singlethreaded
release one. If it should call my fprintf then your code needs to magically
call different fprintf-s depending on who gave it the FILE *. (This can
actually be done with pure C++ interfaces but not with C APIs).

> As far as I can see:
> - when distributing a LIB you need to make up to 8 versions:
> ST / MT, debug / release
> - what about gcc users of your LIB, who will not be using
> MSVCRTxxx.lib?

And MTDLL one and also multiply this by 2 for MBCS/Unicode builds.

> Considering this, are .LIB any useful? If yes: to which purpose?

Are screwdrivers any useful? Last time I visited a tool store there were
hundreds of different varieties there.

> Are
> DLLs the only way of safely working with libraries?

This question is meaningless as you didn't define what is a library and what
is safely.


--
Eugene
http://www.gershnik.com


.



Relevant Pages

  • Re: Different C runtime libraries
    ... For example the debug and release CRT ... >>> version should have exactly the same interface. ... If my .LIB ... >> lib passes it to fprintf which fprintf should be called? ...
    (microsoft.public.vc.language)
  • Re: Different C runtime libraries
    ... For example the debug and release CRT ... >> version should have exactly the same interface. ... .LIB should be only seen as a bunch of .OBJ ... > passes it to fprintf which fprintf should be called? ...
    (microsoft.public.vc.language)
  • Re: How to "import" an interface into a module w/o `include?
    ... libs but not one file per lib. ... do you mean that you have used 'vlog' to compile your source files ... into ModelSim libraries of those names? ... could possibly know it's an interface). ...
    (comp.lang.verilog)
  • Static Library Containing Dialog and Resource
    ... I have a static library that links with the static MFC lib. ... Everything works great with the debug build. ... But when the calling app that links in the ... Access Violation - nothing odd shows up in the debug build. ...
    (microsoft.public.vc.mfc)
  • Re: ICaptureGraphBuilder2 linker error
    ... > thanks, TMH, now i succeeded link the project. ... Interface GUIDs are ... strmbasd.lib and strmbase.lib are not in DS lib directory. ... Specifiying full path is not necessary under these ...
    (microsoft.public.win32.programmer.directx.video)