Trouble compiling 0.301 with VC6

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

Moderator: Moderators

Locked
zykl0nb
Posts: 6
Joined: 2003-10-28 20:44
Contact:

Trouble compiling 0.301 with VC6

Post by zykl0nb » 2003-10-28 20:49

Alright, I'm pretty sure I have everything set up correctly with the includes and such, everything builds except DCPlusPlus. Client builds with a lot of warnings, but DCPlusPlus gives the following errors:

Code: Select all

--------------------Configuration: DCPlusPlus - Win32 Debug--------------------
Compiling...
MainFrm.cpp
c:\dcplusplus\client\util.h(270) : warning C4100: '__$ReturnUdt' : unreferenced formal parameter
C:\dcplusplus\windows\MainFrm.cpp(145) : error C2660: 'Create' : function does not take 1 parameters
WinUtil.cpp
c:\dcplusplus\client\util.h(270) : warning C4100: '__$ReturnUdt' : unreferenced formal parameter
C:\dcplusplus\windows\WinUtil.cpp(392) : error C2039: 'QueryStringValue' : is not a member of 'CRegKey'
        c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(4719) : see declaration of 'CRegKey'
Generating Code...
Error executing cl.exe.
Creating browse info file...

DCPlusPlus.exe - 2 error(s), 2 warning(s)
...any ideas?

Gratch06
Posts: 141
Joined: 2003-05-25 01:48
Location: USA

Post by Gratch06 » 2003-10-28 21:04

Are you using the specific new stlport that arne upgraded to in .300?

- Gratch06

zykl0nb
Posts: 6
Joined: 2003-10-28 20:44
Contact:

Post by zykl0nb » 2003-10-28 21:24

Yes, I am. The error would lead me to believe it has something to do with the CRegKey class...it also says that transferView.Create() does not take 1 paramater, but is passed only one in MainFrm.cpp.

kone
Posts: 2
Joined: 2003-05-24 18:49

Post by kone » 2003-10-29 06:51

to be able to compile:

1. Change these to work in lines: 48 (util.h) and 61 (user.h): (many times mentioned in the forum already)

Code: Select all

static const size_t bucket_size = 4; 
static const size_t min_buckets = 8;
to:

Code: Select all

#if _MSC_VER == 1200 
	enum {bucket_size = 4}; 
	enum {min_buckets = 8}; 
#else 
	static const size_t bucket_size = 4; 
	static const size_t min_buckets = 8; 
#endif // _MSC_VER == 1200
2. Next we have these couple of problems:
This is crude fix, so use it at your own risk. Someone out there please give us a real fix.

windows\MainFrm.cpp line: 145:

Code: Select all

transferView.Create(m_hWnd);
to:

Code: Select all

transferView.Create(m_hWnd, rcDefault);
and
windows\WinUtil.cpp line: 392:

Code: Select all

if(key.QueryStringValue(NULL, buf, &len) == ERROR_SUCCESS) {
to:

Code: Select all

if(key.QueryValue(NULL, buf, &len) == ERROR_SUCCESS) {
3. Last the Linkin errors next

Add these to the project:
windows\StatsFrame.cpp to DCPlusPlus files -> Source files
windows\StatsFrame.h to DCPlusPlus files -> Header files
windows\UCPage.cpp to DCPlusPlus files -> Source files
windows\UCPage.h to DCPlusPlus files -> Header files
windows\CommandDlg.cpp to DCPlusPlus files -> Source files

zykl0nb
Posts: 6
Joined: 2003-10-28 20:44
Contact:

Post by zykl0nb » 2003-10-29 19:19

Thank you very much! I'm now able to compile. There are still a lot of warnings though, but I can live with that. What is the distribution compiled under? It seems weird that VC6 would require those two line changes.

joakim_tosteberg
Forum Moderator
Posts: 587
Joined: 2003-05-07 02:38
Location: Sweden, Linkoping

Post by joakim_tosteberg » 2003-10-30 00:47

THe porejc are currently compiled under VC7.1 .

knightmare
Posts: 1
Joined: 2003-10-28 14:26
Location: Portugal

Post by knightmare » 2003-10-30 12:32

kone wrote:
1. Change these to work in lines: 48 (util.h) and 61 (user.h): (many times mentioned in the forum already)

Code: Select all

static const size_t bucket_size = 4; 
static const size_t min_buckets = 8;
to:

Code: Select all

#if _MSC_VER == 1200 
	enum {bucket_size = 4}; 
	enum {min_buckets = 8}; 
#else 
	static const size_t bucket_size = 4; 
	static const size_t min_buckets = 8; 
#endif // _MSC_VER == 1200
I think that it would be good if at least this fix could be incorporated on the dc++ code, it would avoid lots of problems for people who use vc 6 (and maybe the other two fixes too, if they really are equivalent to the unfixed code - I did the same changes as you, when applying my code to the new version, but it was more or less by instinct and little checking of the documentation).

I appreciate arne's effort to keep most things on the project compatible with vc 6, for example including the vc 6 project files, but there are some simple things like this which could be done. Now that I think about it, I suppose the new .cpp/header files are not included on the vc 6 projects because arne doesn't have vc 6 to save the updated projects...

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: Trouble compiling 0.301 with VC6

Post by GargoyleMT » 2003-10-30 21:30

zykl0nb wrote:

Code: Select all

c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(4719) : see declaration of 'CRegKey'
...any ideas?
Notice the paths? It looks like you're using the ATL built in to VS6. You need to get ATL 7.0 and include it before your standard VS6 include paths.

Locked