EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Trouble with DR3 (https://www.eqemulator.org/forums/showthread.php?t=18142)

sonicintuition 03-17-2005 09:11 AM

Trouble with DR3
 
Greetings,

Is there anyone out there who been able to successfully compile the current CVS dump (DR3) in windows using VS.NET 2k3? I was able to compile World.exe, EQsharemem.dll, however Zone.exe will not compile, due to numerous "Constant too big" errors, 33 to be exact. I read another post regarding this issue and nobody answered the person. Then I found another post about the same thing in which FNW replied saying to make the constants smaller. I go to the lines where these errors are listed at, and find nothing that looks like it needs to be, or even should be adjusted, and certainly doesn't look like the examples FNW gave.

If anyone has been able to get around this, please tell me how it is done, OR, if anyone is willing to share a copy of the latest perl-enabled compilation of Zone.exe (DR3) please PM me. I would prefer to do my own compiling but at this point am willing to settle for someone elses.

Thanks in advance.

Regards,
SI

sysadmin 03-17-2005 10:52 AM

SEARCH BUTTON IS YOUR FRIEND

sonicintuition 03-18-2005 02:21 AM

First, that didn't help. I'm not looking for quick smart-ass replies, like "Search is your friend" because ...I did search, for a long time, and that is why I bothered to post in the first place. Second, the post you linked to does not help me.

Quote:

Then I found another post about the same thing in which FNW replied saying to make the constants smaller. I go to the lines where these errors are listed at, and find nothing that looks like it needs to be, or even should be adjusted, and certainly doesn't look like the examples FNW gave.
What you linked, is what I was referring to.

The examples he shows there does not even come close to anything shown on the lines that VS.NET reports the "Constant too big" error. Being that I am not a coder, I am unable to know what needs to be changed. I have never had a problem compiling the server binaries on my own till now, and that's what I need help with.

Still requesting help with this, or anyone generous enough to donate a DR3 Zone.exe. Thanks.

Regards,
SI

mrea 03-18-2005 02:41 AM

If the post http://www.eqemulator.net/forums/sho...89&postcount=2 is what sysadmin linked it is exactly your problem. Do what it says and you'll be in good shape

sonicintuition 03-18-2005 03:49 AM

Alright, I'm going to have to post some examples. What FNW shows in that thread is NOT what I'm seeing on the lines that show as containing errors. Here are a few examples:

This is what shows in the VS.NET compiler after trying to compile. This is just ONE example of 33 errors, all are the same, "Constant too big":
Quote:

c:\EQEmuCVS\Source\zone\AA.cpp(489): error C2177: constant too big
I then double click that to go right to that file and line to edit it, and find this:
Quote:

aps->experience = (int32)(((float)330.0f * (float)m_pp.expAA) / (float)max_AAXP);
Not the 99999990e111 type thing that FNW is talking about. Soo...what would I edit in that line? I tried adjusting the numbers in a few of these instances but nothing changed, or errors started showing up in other files. Please note that almost all of the errors that showed up contained lines like this one, with a lot of mumbo jumbo and no large arbitrary numbers such as those described by FNW.

Here's another example:
Quote:

c:\EQEmuCVS\Source\zone\aggro.cpp(896): error C2177: constant too big
Going there shows me this:
Quote:

float perwalk_x = 0.5;
There are 5 lines almost exactly like this in the code surrounding that line. Why are they not pointed out like this one?

I am very new at C++ coding. The extent of my abilities include creating a hello world program in the console, and (used to be) compiling EQemu flawlessly. When I look at lines like that above though, it's a foreign language to me. I am very willing to learn, and am currently making an attempt in my spare time to work on my C++ skills, but I really need help with this.

Regards,
SI

sysadmin 03-18-2005 04:20 AM

as is saif.. SEARCH IS YOUR FRIEND
 
Visual Studio Developer site says

Quote:

Compiler Error C2177
constant too big

A constant value is too large for the variable type it is assigned.

The following sample generates C2177:

// C2177.cpp
int main() {
int a=18446744073709551616; // C2177
int b=18446744073709551615; // OK
}

FNW knows his stuff, I don't but I was smart to find the same answer on VS2005 website and you did not, even when you searched "for a long time". Also you should rename yourself to sonic because as I see you have no intuition.

sonicintuition 03-18-2005 04:41 AM

As you can see in my above post, I clearly state that I am very new to C++ coding, and reading this stuff is like a foreign language. Being new I would have no clue if the errors are something native to the EQemu code itself or something that can be fixed with outside help, therefore I did not look outside the community for assistance. Now that you've explained that to me, I will do that. Thanks for your advice.

Regards,
SI

sysadmin 03-18-2005 04:43 AM

You are in a better position than me, I do not know ANY c or c++ or VC or any other flavor. I myself have been flamed MANY times because I did not searched for the answer, or was dumb enough to not find the answer on the internet.

I simply was pointing out that WE(includes me also) should do the best in our power to find the answer before buggin a developer since they have more important things to think about and solve before answering any of mine or anyone elses noob questions.

RangerDown 03-18-2005 04:52 AM

There's no need for the personal attacks. The code that SI is reporting is worthy of investigation, since 0.5 should be a perfectly valid value for a float. The MSKB article posted does little to remedy the fact that 0.5 is a nice middle-of-the-road value for a "float" type.

What may be wrong in this case is either the compiler you're using is somehow confused or improperly set, or the actual offender is one or two lines above or below the line number you're seeing in error messages. Your compiler may, for whatever reason, have a different idea of what a "float" is than the standard data type.

If others are getting C2177's on those very lines, then something may be wrong with the code. But I've visually verified the code you pasted follows proper syntax, and since you are the only one reporting errors there, we have to assume the problem lies in the compiler you are using.

sysadmin 03-18-2005 09:51 AM

In my experience with other programming languages the same compiler led to different errors when using different hardware, aside the options used to configure the compiler.

I think the best possible solution would be to search the knowledge base at the compiler's developer site. They might have already a solution, or at least a workaround.
.

sysadmin 03-18-2005 10:38 AM

This might be irrelevant to the problem in VS2k3 but an interesting read, seems microsoft crippled the c compilers a long time ago due to a marketing decision.

Link

Jack Klein wrote:
Quote:

Re: Error C2177 Constant too big when compiling Gammal.c
On 3 Mar 2004 15:51:34 -0500, Antoun Kanawati <antounk@comcast.net> wrote in
comp.lang.c++.moderated:

Quote:

The constant is a "long double". VC++ 4.0 predates civilization :-) and did not know about such types (long-double and long-long).
This is just plain wrong, at least about long double. Microsoft knew very well what long double was, from version 3.0 of their MS-DOS only Microsoft C compiler. They supported the Intel coprocessor/FPU 80 bit extended precision type.

This support continued through all of their 16-bit compilers (Microsoft C and C++ 7.0, and Visual C++ 1.52). It was only when they introduced Windows NT and 32 bit compilers that they made a marketing decision to drop extended precision type.

Their stated reason was that some of the processors for which they were planning to sell Windows NT did not have hardware support for floating point types wider than 64 bits. Their decision was that portability to other processors running Windows NT was more important than the programmer's decision whether or not to choose precision over compatibility.

You can see this on Microsoft's web site at the following link:

http://support.microsoft.com/support.../Q129/2/09.asp

Quote:

Try with a current gcc/g++ or VC++. I don't recall if VC++ 6.x has long doubles, but it's worth a try.
Visual C++ 4, 5, and 6 all supported long doubles. But they all implement long double as 64 bit FPU floating point types, identical with double. The last version of Visual C++ that supported 80 bit Intel FPU extended precision 80 bit types for long double was the last 16 bit compiler,
Visual C++ 1.52.

I wouldn't know if they have brought this support back in 7.0 or 7.1, but I doubt it.

Their marketing decision seriously cripples Visual C++ on the x86 for some types of serious numerical and engineering programming. Others, such as Borland and GCC, do not have this limitation.
.

sonicintuition 03-18-2005 02:39 PM

Thanks guys. Now that I have a clearer picture of why this may be happening I'm not so damned confused. I'm not even going to try compiling this any more, nothing I've tried is making anything any better. Changing numbers around only leads to more constant too big errors on other lines in other files. Messing with something this deep is just too much for someone with almost 0 experience in C++ coding. So I'll just let the developers do their thing for now.

I'm still requesting a copy of DR3's Zone.exe from anyone generous enough, since that is now my only option of getting it. I just wanted to test it out on my server, see the new bug fixes in action, etc. If anyone would be willing to lend a hand PM me. Thank you.

Regards,
SI

sysadmin 03-18-2005 03:18 PM

I would suggest you register on a Microsoft support forum and post the problem there. I am not sure you will get a solution, but at least would make microsoft aware of the error you are having.

sonicintuition 03-19-2005 02:30 AM

I'll probably do that because, despite my frustration, I'd still like to learn how to program with C++ and I'm sure there is a wealth of knowledge to be had there. Thanks again for the advice.

I've been offered a copy of Zone.exe for DR3 so I won't be posting about this anymore. Thanks to all who tried to help.

Regards,
SI

sysadmin 03-19-2005 05:01 PM

It seems this will not change anytime soon since they are still using 64bit long double double for variable structure.

This is straight from MS Visual Studio website:

Quote:

Double Structure
Represents a double-precision floating point number.

For a list of all members of this type, see Double Members.

System.Object
System.ValueType
System.Double

[Visual Basic]
<Serializable>
Public Structure Double
Implements IComparable, IFormattable, IConvertible
[C#]
[Serializable]
public struct Double : IComparable, IFormattable, IConvertible
[C++]
[Serializable]
public __value struct Double : public IComparable, IFormattable,
IConvertible
[JScript] In JScript, you can use the structures in the .NET Framework, but you cannot define your own.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks
The Double value type represents a double-precision 64-bit number with values ranging from negative 1.79769313486232e308 to positive 1.79769313486232e308, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and Not-a-Number (NaN).

hellkat138 03-29-2005 05:07 AM

C2177
 
Im getting the exact same thing he is on visual basic 2003

garim12 04-10-2005 09:48 AM

I had the same problem on my machine using Visual Studio .NET 2003... the real root of the problem is that Microsoft's compilers rarely tell you where the real problem is. They'll claim a problem with a line like

GroupEXPBonus = 0.1;

when the real problem is in a completely different source file that it included 1000 lines ago.
According to FLT_MAX on my system, the max size for a float in VS.NET 2k3 is about 3.4e38... so all the recently changed lines that increased constant sizes will break this compiler.


Anyway, here's all the places in the recent CVS version where constants are too big for VS.NET 2k3:


zone\client.cpp, line 209-211
Quote:

proximity_x = 9e100; //arbitrary large number
proximity_y = 9e100;
proximity_z = 9e100;

zone\client.h, line 293
Quote:

inline void ClearAllProximities() { entity_list.ProcessMove(this, 1000e99, 1000e99, 1000e99); proximity_x = 1000e99; proximity_y = 1000e99; proximity_z = 1000e99; }

zone\map.cpp, line 83-88
Quote:

_minz = 999999e111;
_minx = 999999e111;
_miny = 999999e111;
_maxz = -999999e111;
_maxx = -999999e111;
_maxy = -999999e111;

zone\pathing.cpp, line 549-550
Quote:

best_dist2 = 9999999e111;
bestl_dist2 = 9999999e111;

The easy quick solution is to change all of these to something smaller. The better solution is probably using something like this:

Quote:

#ifdef WIN32
#DEFINE MAXFLOAT 999e10
#else
#DEFINE MAXFLOAT 999e100
#endif
...but I don't really know if this problem exists in all Windows based compilers or just Visual Studio.

LethalEncounter 04-23-2005 01:07 PM

If anyone is still having this problem:

1. Open client.h and find ClearAllProximities()
2. Change all the 1000e99 on that line to FLT_MAX.
3. Add #include <float.h> to the top of the file.

This should fix the vast majority of the "costant too large" messages. Any other errors should be easy to identify and fix, the reason why this instance was hard to find was because VS .Net would say the error was at a seemingly random location instead of the real location. Compounding this was the fact that about 30 files include client.h, making it seem like you had a ton of errors when it was really just one.

RangerDown 04-23-2005 02:13 PM

Thanks Lethal!!

You're dropping the Edgar1898 handle I see :(


All times are GMT -4. The time now is 08:30 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.