(Warum ich das versuche: Ich hatte kein Glück bei der Verwendung der vorgefertigten Binärdateien für libpng unter Windows (trotz vieler Stunden des Ausprobierens) und versuche daher jetzt, sie selbst zu kompilieren. Ich fand diesen hilfreichen Blogbeitrag diesbezüglich komplett mit einer Microsoft Visual Studio 2008 Projektdatei, konnte diese aber leider noch nicht verwenden.)
Es wird erfolgreich kompiliert, wenn es mit der gefundenen zlib-Binärdatei verknüpft wird hieraber wenn ich versuche, es mit einer Testdatei zu verknüpfen, erhalte ich Folgendes:
C:\Documents and Settings\Administrator\My Documents>cl "C:\Documents and Settin gs\Administrator\My Documents\test.c" "C:\Documents and Settings\Administrator\M y Documents\libpng.lib" -I "C:\Documents and Settings\Administrator\My Documents\include" Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. test.c Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:test.exe test.obj "C:\Documents and Settings\Administrator\My Documents\libpng.lib" MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _abort already defined in LIBCMT.lib( abort.obj) MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fread already defined in LIBCMT.lib( fread.obj) MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMT.lib (malloc.obj) MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMT.lib(f ree.obj) MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: ___iob_func already defined in LIBCMT .lib(_file.obj) LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; u se /NODEFAULTLIB:library test.exe : fatal error LNK1169: one or more multiply defined symbols found
Könnte jemand etwas Licht ins Dunkel bringen, wie man diese Fehler beheben kann?