r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Compile errors
Pages: [1]
Print
Author Topic: Compile errors  (Read 12335 times)
Vikerkaar
Guest
« on: April 14, 2008, 12:05:06 pm »

   1.
      1>Linking...
   2.
      1>files.obj : error LNK2019: unresolved external symbol _unzGoToNextFile referenced in function _FS_LoadPackFile
   3.
      1>files.obj : error LNK2019: unresolved external symbol _unzGetOffset referenced in function _FS_LoadPackFile
   4.
      1>files.obj : error LNK2019: unresolved external symbol _unzGetCurrentFileInfo referenced in function _FS_LoadPackFile
   5.
      1>files.obj : error LNK2019: unresolved external symbol _unzGoToFirstFile referenced in function _FS_LoadPackFile
   6.
      1>files.obj : error LNK2019: unresolved external symbol _unzGetGlobalInfo referenced in function _FS_LoadPackFile
   7.
      1>files.obj : error LNK2019: unresolved external symbol _unzOpen referenced in function _FS_LoadPackFile
   8.
      1>unzip.obj : error LNK2019: unresolved external symbol _envargs referenced in function _main
   9.
      1>unzip.obj : error LNK2019: unresolved external symbol _handler referenced in function _main
  10.
      1>unzip.obj : error LNK2019: unresolved external symbol _extract_or_test_files referenced in function _process_zipfile
  11.
      1>unzip.obj : error LNK2019: unresolved external symbol _readbuf referenced in function _process_zipfile
  12.
      1>unzip.obj : error LNK2019: unresolved external symbol _open_input_file referenced in function _process_zipfile
  13.
      1>unzip.obj : error LNK2019: unresolved external symbol _do_string referenced in function _process_end_central_dir
  14.
      1>unzip.obj : error LNK2019: unresolved external symbol _makelong referenced in function _process_end_central_dir
  15.
      1>unzip.obj : error LNK2019: unresolved external symbol _makeword referenced in function _process_end_central_dir
  16.
      1>unzip.obj : error LNK2019: unresolved external symbol _match referenced in function _list_files
  17.
      1>unzip.obj : error LNK2019: unresolved external symbol _dateformat referenced in function _list_files
  18.
      1>./build/binaries/debug/r1q2.exe : fatal error LNK1120: 16 unresolved externals


I have included unzip.c, unzip.h,ioapi.c, ioapi.h, compiled zlib.lib and added it to SDK also other zlib files aswell..

These are winmm.lib wsock32.lib zlib.lib dxguid.lib dinput8.lib dsound.lib user32.lib linked right now. (DX SDK is installed)

So what is missing?
Logged
QwazyWabbit
Member

Posts: 402


« Reply #1 on: April 14, 2008, 11:35:57 pm »

You don't say what version of R1Q2 or what version Microsoft compiler. I will assume b7587 and VC++ 2005 or 2008.

The link error is caused by not finding zlib.lib in linker path. Make sure the zlib.lib and zlibd.lib files are on an accessible path or have been moved from the directory you built them in to the lib folder for the version of VC you are using.

For VC++  6.0: C:\Program Files\Microsoft Visual Studio\VC98\Lib
For VC 9.0 (2008): C:\Program Files\Microsoft Visual Studio 9.0\VC\lib

You can also leave the libs in their own directories and add the paths to the VC linker search path, if you do this in the general environment it will make them available for all your projects. I prefer to copy them into the main lib folders because they are seldom rebuilt.

Make sure you have built the libs and project you use with them with the same version compiler.
The zlib source is available here: http://www.zlib.net/

I do not believe r1ch includes the zlib code with his project, you must get the libs or the code yourself.


« Last Edit: April 14, 2008, 11:42:14 pm by QwazyWabbit » Logged
Vikerkaar
Guest
« Reply #2 on: April 14, 2008, 11:54:06 pm »

Thank you for reply,

Sorry.. I totally forgot to include what compiler & version of r1q2. Both your assumptions were correct.

It's MSVS 2008 pro & source is b7587.

And as you said, "I prefer to copy them into the main lib folders". Thats what i did too. I compiled the zlib from the source (before i made the last post) and copied files into VC folders. Allthough i seem to miss one thing you mentioned "zlibd.lib". (Such file didnt compile from source..)

Unfortunetly i dont have much time right now so i have to look into it later. I will update my progress in 12h+
Logged
Vikerkaar
Guest
« Reply #3 on: April 15, 2008, 11:07:08 am »

Code:
1>common.obj : error LNK2019: unresolved external symbol _inflateEnd@4 referenced in function _ZLibDecompress
1>unzip.obj : error LNK2001: unresolved external symbol _inflateEnd@4
1>common.obj : error LNK2019: unresolved external symbol _inflate@8 referenced in function _ZLibDecompress
1>unzip.obj : error LNK2001: unresolved external symbol _inflate@8
1>common.obj : error LNK2019: unresolved external symbol _inflateInit2_@16 referenced in function _ZLibDecompress
1>unzip.obj : error LNK2001: unresolved external symbol _inflateInit2_@16
1>common.obj : error LNK2019: unresolved external symbol _deflateEnd@4 referenced in function _ZLibCompressChunk
1>sv_user.obj : error LNK2001: unresolved external symbol _deflateEnd@4
1>zip.obj : error LNK2001: unresolved external symbol _deflateEnd@4
1>common.obj : error LNK2019: unresolved external symbol _deflate@8 referenced in function _ZLibCompressChunk
1>sv_user.obj : error LNK2001: unresolved external symbol _deflate@8
1>zip.obj : error LNK2001: unresolved external symbol _deflate@8
1>common.obj : error LNK2019: unresolved external symbol _deflateInit2_@32 referenced in function _ZLibCompressChunk
1>sv_user.obj : error LNK2001: unresolved external symbol _deflateInit2_@32
1>zip.obj : error LNK2001: unresolved external symbol _deflateInit2_@32
1>files.obj : error LNK2019: unresolved external symbol _unzGoToNextFile referenced in function _FS_LoadPackFile
1>files.obj : error LNK2019: unresolved external symbol _unzGetOffset referenced in function _FS_LoadPackFile
1>files.obj : error LNK2019: unresolved external symbol _unzGetCurrentFileInfo referenced in function _FS_LoadPackFile
1>files.obj : error LNK2019: unresolved external symbol _unzGoToFirstFile referenced in function _FS_LoadPackFile
1>files.obj : error LNK2019: unresolved external symbol _unzGetGlobalInfo referenced in function _FS_LoadPackFile
1>files.obj : error LNK2019: unresolved external symbol _unzOpen referenced in function _FS_LoadPackFile
1>sys_win.obj : error LNK2019: unresolved external symbol _gzclose@4 referenced in function _R1Q2ExceptionHandler
1>sys_win.obj : error LNK2019: unresolved external symbol _gzwrite@12 referenced in function _R1Q2ExceptionHandler
1>sys_win.obj : error LNK2019: unresolved external symbol _gzopen@8 referenced in function _R1Q2ExceptionHandler
1>unzip.obj : error LNK2019: unresolved external symbol _crc32@12 referenced in function _unzReadCurrentFile@12
1>zip.obj : error LNK2001: unresolved external symbol _crc32@12
1>./build/binaries/release/r1q2.exe : fatal error LNK1120: 16 unresolved externals

So i compiled zlibd.lib also and pretty much all the zlib projects got compiled, except asm. They are all reffered, each in different folder. in my VC++ Directories.

ioapi.c ioiapi.h  zip.c zip.h unzip.c unzip.h zconf.h zlib.h are also reffered.

Linkage:
winmm.lib
wsock32.lib
zlib.lib
dxguid.lib
dinput8.lib
dsound.lib
user32.lib
Logged
Vikerkaar
Guest
« Reply #4 on: April 15, 2008, 04:37:21 pm »

I got it compiled.

Had to include some files from zlib and minizip..
Logged
Vikerkaar
Guest
« Reply #5 on: April 15, 2008, 05:00:55 pm »

I have a question, why is my compiled r1q2.exe 300kb smaller than the one i got through update?
And.. Why there is (mod) in console.
Logged
Prabakar
Guest
« Reply #6 on: April 25, 2008, 07:28:52 am »

Linking...
ZipArchive.obj : error LNK2001: unresolved external symbol _inflateInit2_
ZipArchive.obj : error LNK2001: unresolved external symbol _inflate
ZipArchive.obj : error LNK2001: unresolved external symbol _crc32
ZipArchive.obj : error LNK2001: unresolved external symbol _inflateEnd
ZipArchive.obj : error LNK2001: unresolved external symbol _deflateInit2_
ZipArchive.obj : error LNK2001: unresolved external symbol _deflate
ZipArchive.obj : error LNK2001: unresolved external symbol _deflateEnd
Release/UADMailer.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

UADMailer.exe - 8 error(s), 0 warning(s)

hi . i am getting above errors while compiling the program,, i have included zlib.h header file. but stil i am getting same error. is there any linking to avoid above errors
Logged
QwazyWabbit
Member

Posts: 402


« Reply #7 on: April 25, 2008, 09:45:24 am »

This doesn't look like it's related to r1q2 but...

Link to zlibd.lib in debug build and link to zlib.lib in release build.
You need to put the libs in your project directory or into the library path accessible to your compiler environment as I outlined above.
Logged
QwazyWabbit
Member

Posts: 402


« Reply #8 on: April 25, 2008, 09:54:53 am »

I have a question, why is my compiled r1q2.exe 300kb smaller than the one i got through update?
And.. Why there is (mod) in console.

I can't explain the size difference but I think the (mod) flag is R1ch's way of showing the code wasn't compiled and distributed by him. The checking mechanism may be unique and internal to his distro.
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Compile errors
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines