lua-users home
lua-l archive

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

David Manura <> writes:

> steve donovan writes:
> > On Mon, Aug 4, 2008 at 1:11 PM, Paul Moore wrote:
> > > It's up to you, I guess, but I find msvcr80/msvcr90 builds fraught
> > > with problems...
> Since the msvc*.dll issue is becoming a recurring topic, some notes/links are
> now collected here: .  Feel free to
> expand.

Okay, i didn't understood everything of this thread and i'm sorry if this is
out-of-topic, but i have had similar headaches with library conflicts in the
past. And execuse my terminology, i didn't used Visual Studio for a long time.

In the case that you use #pragma comment(lib, ...) to automatically have
library dependencies registers againt the thing that you build, then try
to NOT use that, don't be fooled: It's definitely NOT the same than
adding yourself the library in the project properties.

At least on VS .Net 2005. The last time i triggered the problem (which took
me 2-3 days to identify), was when i used the officialy-released WxWidgets
library (compiled under VS 2003), for a project of my own compiled with VS
.Net 2005, which raised error something like "MSVCR80.dll not found, [...]"
at runtime.

This problem whas that the #include of WxWidgets' headers automatically
register library dependencies by using #pragma comment(lib, ...). But again,
this is NOT the same than adding yourself the dependencies (Dependency
Walker would confirm that). So i resolved the problem by commenting out
WxWidget's #pragmas and adding myself the dependencies. I would bet on a
bug of #pragma comment(lib, ...).

Thanks to this blog which put me on the right track (event if i don't speak

This issue with differents CRT is somewhat general. The last time i've seen
it was on a Protocol Buffers discussion on google groups. I've also seen it
by the past on lot of foruns' topics, and the problem was tricky,
because some people (which used #pragma) asked for help, and some others
people (which used project properties) answered "for me, it just works", just
because everyone assumed that the two methods were the same (which seems a
fine assumption), and it confuses everyone.

Either i didn't understood anything related to CRT's and i'm completly
wrong, OR there is a HUGE problem with #pragma, and i hope this thread will
help someone, for not necessarily Lua-related problems.

> Though it's quite preferable to use the same C runtime, in theory I see nothing
> incorrect with mixing libraries linked against different C runtimes provided
> some strong assurances are given from those libraries.  Perhaps it's ideal,
> *when possible*, for a C extension DLL to dynamically link to no C run-time at
> all (i.e. /nodefaultlib /entry:... linker options in MSVC).  It may be
> worthwhile for someone to clarify this all in practice.