[vorbis-dev] Win32 builds

Dimitry Andric dim at xs4all.nl
Wed Nov 7 11:58:54 PST 2001



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2001-11-07 at 20:03:34 Brian Hook wrote:

BH> For example, if I use LIBCMTD.LIB, I get:

BH> ogg_static_local.lib(framing.obj) : error LNK2001: unresolved external
BH> symbol __imp__memchr

This means that at least the framing.obj file - but most likely the
whole library - was compiled with the "Debug Multithreaded DLL" option
selected in Project Settings | C/C++ | Category: Code Generation | Use
run-time library (which sets the /MDd compiler option). It then tries
to link to the memchr function which is exported from MSVCRTD.DLL, in
this case.

BH> However, If I specify MSVCRTD.LIB that error goes away.

Yes, because it can then find the memchr function to import. However,
it causes an ambiguity between the memchr function from libcmtd.lib
and the one from msvcrtd.lib.

BH> The original problem was that there were conflicts between MSVCRTD.LIB
BH> and LIBCMTD.LIB,

If you get _any_ such linker errors/warnings, you should take care,
and please don't ignore them. It means that you are mixing code
compiled with the (static) Multithreaded run-time (i.e. libc*.lib) and
the (dynamic) DLL run-time (i.e. msvcrt*.lib).

Many people simply use the /nodefaultlib linker option to suppress
these warnings, but that can cause subtle bugs in the produced
executables. Think of a pointer being malloc()ed via the DLL run-time,
and then free()d via the static run-time. Behaviour: undefined. :)

So, in view of the messages you mentioned, I'm inclined to believe
that the ogg_static_local.lib file was compiled with the Multithreaded
DLL version of the run-time library, so the easiest fix is to compile
all your "client" code with the same option. However, this might not
be acceptable, since you would need to supply msvcrt[d].dll with your
final executable(s).

The other fix is to recompile the vorbis libraries with the static
Multithreaded run-time, which requires modifying the vorbis_static.dsp
project file.

Normally I use my own dsp files to compile vorbis libraries, if you're
interested I can post them somewhere.

BH> however I went through and removed EVERY reference that could
BH> possibly target MSVCRTD.LIB and still no go, there are still
BH> conflicts with it.

That's because VC++ is inserting its own code which uses the dynamic
run-time, again caused by the /MDd or /MD compiler options.

Cheers,
- --
Dimitry Andric <dim at xs4all.nl>
PGP Key: http://www.xs4all.nl/~dim/dim.asc
Fingerprint: 7AB462D2CE35FC6D42394FCDB05EA30A2E2096A3
Lbh ner abj va ivbyngvba bs gur QZPN

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5i

iQA/AwUBO+mEdbBeowouIJajEQKTzwCeKc9bg9entoDru4CwlEdCLfCUI7MAn2+z
x7YbQYYrqI8eqZ5SCz81Elrs
=8JyC
-----END PGP SIGNATURE-----

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list