Forum

Problem compiling MenuQC

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Problem compiling MenuQC

Postby Nash » Sat Oct 20, 2007 3:18 pm

I extracted the MenuQC source files from the latest DarkPlaces mod in an attempt to understand and use it for my mod, but these errors come up when I try to compile it using frikqcc 2.6:

Code: Select all
error: mbuiltin.qc:50:"," is not a name
error: mbuiltin.qc:51:"," is not a name
error: mbuiltin.qc:52:"," is not a name
error: mbuiltin.qc:54:"," is not a name
error: mbuiltin.qc:55:"," is not a name
error: mbuiltin.qc:56:"," is not a name


If you have the DP mod, look the QC sources for the MenuQC source, but if you don't, here's the problem lines:

Code: Select all
entity   findstring(entity start, .string field, string match)     = #24;
entity   findfloat(entity start, .float field, float match)    = #25;
entity   findentity(entity start, .entity field, entity match)    = #25;

entity   findchainstring(.string field, string match)    = #26;
entity   findchainfloat(.float field, float match)    = #27;
entity   findchainentity(.entity field, entity match)   = #27;


Help please. :(
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Nash » Sat Oct 20, 2007 10:49 pm

I am guessing that this is something the compiler I'm using doesn't support.

So what do I do? I tried switching to FTEQCC but it won't compile because the MenuQC code uses arrays and apparently FTEQCC doesn't support that.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Sat Oct 20, 2007 10:51 pm

The menu code in DPMod is unused (I hope) and 3 years old - I think Black restarted it from scratch a few times since then.

Nexuiz is the only mod I know of which actually uses menu qc, and their code is up to date:

http://svn.icculus.org/nexuiz/trunk/data/qcsrc/menu/
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Nash » Sun Oct 21, 2007 8:11 am

Ah, okay then. I was aware that Nexuiz has working MenuQC but I decided to take the source from DP because it was apparently cleaner and hopefully easier for me to learn from.

Looks like I'm going to have to find some time to dissect that monster from Nexuiz then...
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby leileilol » Sun Oct 21, 2007 8:57 am

MenuQC is a new untreaded, undocumented ground for most since it's so relatively new. I think you're diving into the unknown too early
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Nash » Sun Oct 21, 2007 12:22 pm

Really? I wouldn't know.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Nash » Sun Oct 21, 2007 7:25 pm

Nexuiz's MenuQC also won't compile with FrikQCC 2.6:

Code: Select all
warning: msys.qc:1:unknown pragma flag
error: mbuiltin.qc:62:"," is not a name
error: mbuiltin.qc:63:"," is not a name
error: mbuiltin.qc:236:fopen redeclared (see previous declaration mbuiltin.qc(94))


Code: Select all
62: entity   findflags(entity start, .float field, float match) = #87;
63: entity   findchainflags(.float field, float match) = #88;

...

91: #ifdef FIXEDFOPEN
92: float    _fopen( string filename, float mode ) = #48;
93:  #else
94: float   fopen(string filename, float mode)  = #48;
    #endif

...

234: #ifdef FIXEDFOPEN
235: float    fopen( string filename, float mode ) =
236: {
      local float handle;
      if( mode == FILE_READ ) {
         return _fopen( filename, mode );
      }
   
      // check for data/
      filename = strzone( filename );
      if( substring( filename, 0, 5 ) != "data/" ) {
         print( "menu: fopen: all output must go into data/!\n" );
         return -1;
      }
      handle = _fopen( substring( filename, 5, 10000 ), mode );
      strunzone( filename );
      return handle;
     };
     #endif


The code looks perfectly fine to me. Why is FrikQCC flipping out? :?
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Mon Oct 22, 2007 7:56 am

I don't think FrikQCC does #ifdefs and stuff. I'm pretty sure the Nexuiz team is using FTEQCC.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Nash » Mon Oct 22, 2007 10:17 am

I decided not to bother anymore and just edit the DP source. It makes much more sense than trying to get the MenuQC to compile. :(
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby Sajt » Mon Oct 22, 2007 4:28 pm

Except for the fact that if you release something that is based on a modified DP engine, six months down the line people will be playing your mod with a six month old DP build :(

Although if your changes are minor you could probably merge them into the DP subversion tree, like Nexuiz does.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby FrikaC » Mon Oct 22, 2007 8:23 pm

FrikQCC has limited ifdef support.

The main problem with that code is that FrikQCC treats the name "field" as a reserved word.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby xaGe » Mon Oct 22, 2007 8:47 pm

He doesn't seem to need a current DP engine 6 months down the road, but an engine to do what he needs for is unrelated Quake game now... So when the mod is done its done...

The advantage would be for everyone else to use anything "cool" he might cook up... Anything is possible... :)

Sajt wrote:Except for the fact that if you release something that is based on a modified DP engine, six months down the line people will be playing your mod with a six month old DP build :(



FrikaC: What is the reason for that? I know your busy at the head, but is this something that can be changed via command line parameter or would it be a code change?

FrikaC wrote:FrikQCC has limited ifdef support.

The main problem with that code is that FrikQCC treats the name "field" as a reserved word.
User avatar
xaGe
 
Posts: 461
Joined: Wed Mar 01, 2006 8:29 am
Location: Upstate, New York

Postby FrikaC » Tue Oct 23, 2007 3:19 pm

it's not changeable via commandline, it's a special type modifier, that admittedly has limited use.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Nash » Wed Oct 24, 2007 10:40 am

Thanks for the information, Frika.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby FrikaC » Wed Oct 24, 2007 3:03 pm

The purpose of it is this, for anyone that is curious. Say you have a line like:

.float blah;

it's clear you're defining a field named blah whose return subtype is float. But:

.float(float blegh) blah;

QuakeC handles this as a field whose subtype is function, the function type's subtype is float. But say you wanted to make a function that returns a field. Ain't no way unless you use the FrikQCC field keyword. field keyword works like the . operator only in reverse

float field blah;

declares a .float

float(float blegh) field blah;

declares a .float()

and

float field (float blegh) blah;

declares a function returning a .float. This is extremely limited in it's use and it was one of the wacky pointless features I added at some point. It's just a remedy for the odd associative property of . (it modifies the ENTIRE type to the right of the period, where as most other things modify the previously handled type.)
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest