b_realhead code not compatible with Visual C++ 2003?

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

User avatar
deej
Posts: 743
Joined: Fri Mar 19, 2004 12:44 am
Location: Belgium!
Contact:

b_realhead code not compatible with Visual C++ 2003?

Post by deej »

Hi,

I'm freshening up my C skills (nub atm) and what better way to do this than with the ET SDK ;)! Now as I was strolling through the latest ETPub code I noticed b_realhead was in there, which is very very cool of course!

So I tried compiling it (the ETPub code) on a Linux box with gcc4 and that works like a charm. However with the Visual C++ compiler from MS (you can get the free one here) it starts whining about unreferenced external symbol rint which is mentioned in cg_players.c:

Code: Select all

// zinx - use predictable center so server can match cgame easier
centerAngle = rint(*angle / swingTolerance) * swingTolerance;
It appears that MS does not ship rint in math.h while gcc does. Some posts I found through google say that rint is indeed an official C function but not an official C++ function.

Now putting aside the discussion on compilers & platforms (I know it's C and not C++ code and that MS is evil), wouldn't it be prudent to look for another function already to do the same so that portability is maximised towards future developments? Or am I way off base here?

--------------------

By the way, for those of you who want to compile Visual C++ .sln files without having to obtain MS Visual Studio .NET in one way or another, here's how I did it:

- Install the MS Platform SDK (don't forget to install DB connectivity or the ET SDK doesn't compile).
- Install the Visual C++ 2003 Toolkit
- Install Code::Blocks
- Open the wolf.sln solution and start compiling
Our servers now run on 64 bit steroids. Point your ET to:
- Forgotten Ground StopWatch Server with occasional wolfrof 1
- Fraggle Rock ETPub Server - Mix up ET/UT & Duke Nukem
User avatar
zinx
Posts: 267
Joined: Fri Jan 16, 2004 12:37 pm
Location: US
Contact:

Post by zinx »

I believe we provided our own rint in ET Pro; just make one up w/ something like (int)(x + 0.5)
EDIT: Oh, and C99 might not be a good enough standard for microsoft, but it sure as hell is for the ET Pro team.
Zinx Verituse http://zinx.xmms.org/
User avatar
deej
Posts: 743
Joined: Fri Mar 19, 2004 12:44 am
Location: Belgium!
Contact:

Post by deej »

Hehe don't shoot the messenger, just pointing something out 8).
Our servers now run on 64 bit steroids. Point your ET to:
- Forgotten Ground StopWatch Server with occasional wolfrof 1
- Fraggle Rock ETPub Server - Mix up ET/UT & Duke Nukem
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

just use mingw on linux. then you get a fully c99 complliant compiler.
User avatar
deej
Posts: 743
Joined: Fri Mar 19, 2004 12:44 am
Location: Belgium!
Contact:

Post by deej »

bani wrote:just use mingw on linux. then you get a fully c99 complliant compiler.
Yeah got it to work now. Mingw is not easy to set up for beginners like me. This page helped me out a lot for the brave new souls exploring crosscompilation things.

BTW Zinx I certainly wasn't implying you had done a bad job or something.
Our servers now run on 64 bit steroids. Point your ET to:
- Forgotten Ground StopWatch Server with occasional wolfrof 1
- Fraggle Rock ETPub Server - Mix up ET/UT & Duke Nukem
User avatar
zinx
Posts: 267
Joined: Fri Jan 16, 2004 12:37 pm
Location: US
Contact:

Post by zinx »

Yeah, I just think MSVC still not supporting C99 is amazingly stupid of microsoft, and since they say it's because there's no demand, well, I don't go out of my way to reduce the demand ;)
Zinx Verituse http://zinx.xmms.org/
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

it's only been 6 years, gotta give microsoft some time to catch up with the standards you know...

i hear microsoft might actually implement standard HTML 1.0 someday too...
User avatar
Spoofeh
Posts: 296
Joined: Sat Jul 26, 2003 4:50 am

Post by Spoofeh »

Stanley Lippman, Microsoft's Visual C++ Architect wrote: Microsoft will not simply implement features because they are specified in the standard. They will implement them when people want them because they are beneficial.
:roll:

(link)
User avatar
deej
Posts: 743
Joined: Fri Mar 19, 2004 12:44 am
Location: Belgium!
Contact:

Post by deej »

Yep that's the power of the $ I guess.

In fact it is quite funny to see that security vendors (I work at a Security company) now make their products compliant with 2 standards:

- Known Standards (RFCs and all that)
- "Industrry Standard Best Practice" which is political speak for calling the way MS & Cisco interprete the Known Standards. Although the "best" in best practice is rather, well...

EDIT: maybe Bani should get some open-source vendor to back up ETPro :lol:?
Our servers now run on 64 bit steroids. Point your ET to:
- Forgotten Ground StopWatch Server with occasional wolfrof 1
- Fraggle Rock ETPub Server - Mix up ET/UT & Duke Nukem
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

every microsoft developer I know wants them.

that quote would better read as: "microsoft will implement features when microsoft wants them.", which would better fit the historical data for msdn developer tools.

just about everybody except microsoft has implemented c99. but then, msvc isn't c++ standards compliant either so nobody should be suprised they don't implement c99 :)

halfassed/incomplete standards support pervades microsoft from top to bottom, including html, tcp/ip, etc.
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

There are a couple of features of the ANSI/ISO standard (for instance the ‘export’ keyword as applied to template classes) that won’t be implemented because they are considered by Microsoft to be obscure and, at this stage, theoretical.
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

that's talking about c++, which is a completely different animal from c and the c99 standard. there are no template classes in c.

programmers hate inconsistency. it's extremely annoying to write code for standards-compliant systems, which compiles and runs perfectly on every system on the planet except microsoft. it's like drawing engineering diagrams for 99.999% of the world which is fine with imperial or metric, then finding they won't work for some weird country which insists on using cubits. microsoft is the cubits of the industry.

microsoft's msvc EULA also places rather ridiculous distribution restrictions on applications built with msvc. you don't have any such restrictions when using mingw, and you get a fully c99 standards compliant compiler to boot. and it's free. and it generates better code than msvc.
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

yes, I know, but I was pointing out they won't include anything that's theoretical... which i guess makes this theoretical even though it's used by 99.99% of the world...
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
Blackout
Posts: 84
Joined: Tue Dec 16, 2003 8:45 pm

Post by Blackout »

bani wrote:microsoft's msvc EULA also places rather ridiculous distribution restrictions on applications built with msvc. you don't have any such restrictions when using mingw, and you get a fully c99 standards compliant compiler to boot.
quoted for truth
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

and great justice
Post Reply