.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
  Posts  
When compile errors just go berzerk #1 (Groups : qc : Forum : vault() : When compile errors just go berzerk #1) Locked
Thread Options
numbersix
numbersix quake-c coder++
Nov 14 2016 Anchor

So, you add a few lines of test code and bang!

x_ent/x_ent.qc:1395: error: "if" is not a type
x_ent/x_ent.qc:1411: error: "else" is not a type
x_ent/x_ent.qc:1413: error: "}" is not a type
x_ent/x_ent.qc:1425: error: "if" is not a type
x_ent/x_ent.qc:1453: error: "}" is not a type
x_ent/x_ent.qc:1490: error: "setorigin" is not a type
x_ent/x_ent.qc:1492: error: "e" is not a type
x_ent/x_ent.qc:1493: error: "e" is not a type
x_ent/x_ent.qc:1494: error: "e" is not a type
x_ent/x_ent.qc:1495: error: "e" is not a type
x_ent/x_ent.qc:1496: error: "e" is not a type

************ ERROR ************
Errors have occured

Error in x_ent/x_ent.qc on line 1496

           *** WARNING ***

           progs.dat not created, possible compile failure!

What the?

This code just compiled perfect, nary a warning out of place.

Lets see the code you just cut and paste from another part and changed:

#ifdef warning
//							if (WARNING & 131072)
//							if (WARNING & 2097152)
							{
								bprint(" *** warning:   spawn loop: ");
								bprint(item_ident(self));
								bprint(", code: ");
								bprint(s5__);
								bprint(", slf#: ");
								bprint(ftos(num_for_edict(self)));
								bprint(", ns#: ");
								bprint(ftos(num_for_edict(nspawn)));
								bprint(", org: ");
								bprint(vtos(self.origin));
								bprint("\n");
							}
			}
#endifdef

Well.

The commented out ifs are fine, we've been doing that for a while.

The bprint block was cut and paste from another warning and modified. If you undo the modify, the errors are the same.

The last line in that block is 1372. These are the first 3 lines with errors:

//1395
	if (self.script)

//1411
	else

//1413
};

Have you found the problem yet?

Here is a hint:

							{
// just a code block
							}
			}

Look close at the braces.

We have one opening brace and 2 closing braces.

This throws the compiler off because it will mis-match braces.
The brace just before line 1395 ends the function call.
What follows line 1395 starts generating errors until the compiler gets more than 10 and gives up.

When errors cascade like this and many of them occur around brace blocks
go ahead and trace open / close braces.

Many code highlight editors will match braces when you select one.
I use scite, and it does this. But curiously enough, it wont match across the #ifdef blocks.
Another great tool is version control, like git. You can use git without an online repository too.
Version control tracks changes and allows easy reversion of code back to when things worked better.

Additional note: the "progs.dat not created" warning is from a bash script that runs the compiler.
This tells me if some failure blew the compiler with no indication.

Good luck coding!

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.