Trying to insert GetZ functionality in 0.181-codebase (VC6)

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
sarf
Posts: 382
Joined: 2003-01-24 05:43
Location: Sweden
Contact:

Trying to insert GetZ functionality in 0.181-codebase (VC6)

Post by sarf » 2003-02-02 08:28

Hi there!

I am trying to insert the zlib and the GetZBlock functionality in the 0.181-version (mainly because that code base seems a bit more stable than the new ones), but (unsurprisingly) I have run into problems.

I've added the zlib project to the workspace.
I've added the zlib to the "Project -> Settings" -> "Win32 Debug" -> "DCPlusPlus" -> "Link -> Object/library modules"

I still get these nice link errors (below), so I am wondering if someone knows how to resolve them without resorting to physical violence, human sacrifice to dark powers or getting a nice room at the local nuthouse.

Here are the errors:
--------------------Configuration: DCPlusPlus - Win32 Debug--------------------
Linking...
client.lib(CryptoManager.obj) : error LNK2001: unresolved external symbol @deflateInit_@16
client.lib(CryptoManager.obj) : error LNK2001: unresolved external symbol @deflate@8
client.lib(CryptoManager.obj) : error LNK2001: unresolved external symbol @inflateInit_@12
client.lib(CryptoManager.obj) : error LNK2001: unresolved external symbol @inflate@8
client.lib(DownloadManager.obj) : error LNK2001: unresolved external symbol @inflateEnd@4
client.lib(BufferedSocket.obj) : error LNK2001: unresolved external symbol @deflateEnd@4
App/DCPlusPlus.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

DCPlusPlus.exe - 7 error(s), 0 warning(s)

Hope to be hearing from y'all.

Sarf
---
We're not doing scientific research, we're killing people.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-02-02 11:41

you never know...
..did you make "Win32 Debug" depend on zlib?
i.e. the lib needs to be compiled and linked first of course
(but I figure you know that)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

sandos
Posts: 186
Joined: 2003-01-05 10:16
Contact:

Post by sandos » 2003-02-02 11:52

I think this has to do with default calling conventions/symbol decorations. (cdecl, fastcall, stdcall)

sarf
Posts: 382
Joined: 2003-01-24 05:43
Location: Sweden
Contact:

Post by sarf » 2003-02-02 13:01

Sedulus wrote:you never know...
..did you make "Win32 Debug" depend on zlib?
i.e. the lib needs to be compiled and linked first of course
(but I figure you know that)
Ehm... yes, I compiled the lib first (actually, I have done about three complete rebuilds since I've started trying this). Thanks for the thought, though.
sandos wrote:I think this has to do with default calling conventions/symbol decorations. (cdecl, fastcall, stdcall)
Ah, this might prove a viable route. Unfortunately, I can compile DC++ v0.23 just dandy (with the spiffy zlib), and all zlib functions in the CryptoManager have been pasted from that codebase. I am trying to do a reverse graft (that is, taking my changes to the old CryptoManager and putting them into the new CryptoManager). Let's see how it plays out.
WHEEE!

Ehrm <cough> <cough>... it worked, sandos. The calling convention was cdecl and it should be fastcall (sarf bonks his own head). Thank you very much!
Now if only my proggie didn't crash every five minutes... :)

Thank you both for your help!

Sarf
---
There are three magical words that make everyone feel happy... 'no compilation errors'.

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-02-03 05:07

another good idea might be not to use the getzblock code at all...it's only a prototype...(ever thought about why I actually never add it to the $supports list?)

from ConnectionManager:

Code: Select all

		// This is disabled for now, as it's not finished yet...
		//		features.push_back("GetZBlock");

sarf
Posts: 382
Joined: 2003-01-24 05:43
Location: Sweden
Contact:

Post by sarf » 2003-02-03 11:39

arnetheduck wrote:another good idea might be not to use the getzblock code at all...it's only a prototype...(ever thought about why I actually never add it to the $supports list?)
Even so, I wanted to import some files from 0.23 into 0.181 (the download queue, progress bars et cetera) and those wanted GetZBlock functions (and hence zlib functionality), so... Besides, after a while it started getting on my nerves that I could not get it to compile. Ah well, now it works, even though I could not get the download queue to show any queue items no matter what I did. It showed the download directories alright, but it couldn't parse out the files themselves - probably because the two different source code versions use different ways of handling queue files (as far as I've been able to ascertain).

No matter, I'll just move my grafted functions onto 0.23 instead (featuring, among other things, an option to turn on automated hublist server updating).

By the way, what happened to the ratings server idea? Did it die with lichlord.org?

Sarf
---
Troglodytism does not necessarily imply a low cultural level.

Locked