Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Visual C++/MFC/WTL > Про ZLib: LNK2019: unresolved external symbol


Автор: malor 29.8.2009, 11:08
В каталоге zlib123-dll в файле USAGE.txt написано: 
Цитата
Using ZLIB1.DLL with Microsoft Visual C++
=========================================
   1. Install the supplied header files "zlib.h" and "zconf.h"
      into a directory found in the INCLUDE path list.

   2. Install the supplied library files "zdll.exp" and "zdll.lib"
      into a directory found in the LIB path list.

   3. Add "zdll.exp" or "zdll.lib" to your project.

   Notes:
   - Usually, you don't need both the .exp file and the .lib file.
   - If you wish, you may rename "zdll.exp" to "zlib1.exp", and/or
     rename "zdll.lib" to "zlib1.lib".
Фраза  "Usually, you don't need both the .exp file and the .lib file." говорит "обычно вам не нужно одновременно оба файла(exp  и lib)"? 
Для чего пример переименования приведен в ноте ?

Сделал пункты 1-3, но все равно при попытке Build'a:
Цитата
Warning    1 warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification    commonheaders.obj    
Error    2 error LNK2019: unresolved external symbol _inflateEnd referenced in function "char * __cdecl gzip_decode(char *,int *,int)" (?gzip_decode@@YAPADPADPAHH@Z)    netlibhttp.obj    
Error    3 error LNK2019: unresolved external symbol _inflate referenced in function "char * __cdecl gzip_decode(char *,int *,int)" (?gzip_decode@@YAPADPADPAHH@Z)    netlibhttp.obj    
Error    4 error LNK2019: unresolved external symbol _inflateInit2_ referenced in function "char * __cdecl gzip_decode(char *,int *,int)" (?gzip_decode@@YAPADPADPAHH@Z)    netlibhttp.obj    
Error    5 fatal error LNK1120: 3 unresolved externals    D:\Projects\miranda-im-v0.8.5-src\miranda\src\Debug Unicode\miranda32.exe    
В какой именно папке проекта размещать zdll.exp? Под zdll.lib я нашел расположение - каталог так и называется Lib.

Помимо этого в скачанном с сайта www.zlib.net архиве http://www.zlib.net/zlib123-dll.zip в каталоге lib есть файл zlib.def. Каково его предназначение?

Родственный топик:  http://forum.vingrad.ru/forum/s/56c35f777b993c9086c17eb05523f7c0/topic-163415.html

Windows XP, MS Visual Studio 2005

Автор: malor 30.8.2009, 22:54
Warning    1 warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification    commonheaders.obj    
Ликвидирован выставлением значения Default в настройке :
Project Properties Pages -> Project Configuration -> Linker -> Enable Incremental Linking. 

По поводу error LNK2019.
После добавления в Project properties > Linker > Input > Additional Dependencies
слова zdll.lib команда Build прошла удачно.

Но запуская Debug-> Start without debugging имеем:
Цитата
---------------------------
miranda32.exe - Не удалось найти компонент
---------------------------
Приложению не удалось запуститься, поскольку zlib1.dll не был найден. Повторная установка приложения может исправить эту проблему. 

Как разрулить ? smile 

Автор: Andrey44 31.8.2009, 06:43
zlib1.dll кидай в папку с экзэшником.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)