May 08, 2024, 04:54:47 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Strange error while compiling

Started by Rock Ridge Farm (Larry), August 15, 2006, 11:57:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rock Ridge Farm (Larry)

I have a program that tells me there are errors when compiling but does not list any errors.
Any idea what this means?

kryton9

Delete the .opts files in the folder. The files must have been moved or reorganized. Happens to me all the time.

Rock Ridge Farm (Larry)

Did that - same error - compiler says there are errors but does not list anything.

Ionic Wind Support Team

Project or single compile? 

Check your resources too.
Ionic Wind Support Team

Rock Ridge Farm (Larry)

Just a single compile - that is what is strange.
I am going to start commenting out code to see if I can find what it is.

Rock Ridge Farm (Larry)

Found the offending code:
struct squadron {
   int row, col;
   int course;
   int type;
   int from;
   squadron s_next;
   squadron previous;
   int planes;
   int fuel;
   int attack;
}

squadron federation;

No idea what is wrong with this.

Ionic Wind Support Team

The two lines

   squadron s_next;
   squadron previous;

Should be:

   squadron *s_next;
   squadron *previous;

If your attempting to make your own list.  Better to use the linked list functions for that anyway.  As for why it's just exiting instead of giving you and error message I'll find out and fix it.

Basically if you embed a structure within itself it ends up in an endless loop trying to calculate the infinate size of the structure.  Think about it for a moment.  The member s_next contains the member s_next wich contains the member s_next and so on. 

Paul.
Ionic Wind Support Team

Rock Ridge Farm (Larry)

You are right they should have been pointers - my bad.