Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 735 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Unable to define new struct #136950
06/18/07 01:16
06/18/07 01:16
Joined: Jun 2007
Posts: 3
E
Ekar Offline OP
Guest
Ekar  Offline OP
Guest
E

Joined: Jun 2007
Posts: 3
The following code does not compile in lite-C for me:
typedef struct SPACESHIP{
var x;
} SPACESHIP;

keyword unknown SPACESHIP
Parameter unknown typedef bad keyword in {}
are the errors (along with parm unknown error for the var)
lite-C ver 7.02.4 clean install.

From examples and tutorials I have read, this should work. Any ideas?

Thanks in advance.

Re: Unable to define new struct [Re: Ekar] #136951
06/18/07 10:07
06/18/07 10:07
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
The typedef must be in the global scope I think.

Re: Unable to define new struct [Re: Excessus] #136952
06/18/07 12:13
06/18/07 12:13
Joined: Jun 2007
Posts: 3
E
Ekar Offline OP
Guest
Ekar  Offline OP
Guest
E

Joined: Jun 2007
Posts: 3
It is globally defined. That would be a good first assumption though.

I also note 3 more errors with lite-C

1. #define substitution is not working
2. Switch...Case statements fail to compile
3. ++ syntax is not known either

According to the supplied manual, these are all valid in lite-C. Could it be an issue with having the free version I'm testing? I didn't see these limitations documented anywhere. Then again, I'm probably just missing something silly. That happens a lot as well.

Re: Unable to define new struct [Re: Ekar] #136953
06/18/07 13:21
06/18/07 13:21
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
That's very strange. There are no syntactical limitations in the free version of Lite-C. Here are some possible causes/solutions:

-Instal the latest release of Lite-C (1.03)
-Check your code right before lines that produce errors. There might be something wrong that is the true cause of these errors.
-If you have multiple instalations of gamestudio and/or lite-c, make sure you are running the right SED, or you might invoke the wrong engine. I've had such problems before. Make sure you open the SED from C:\program files\litec, not GStudio6.

The 3 things you mentioned all work fine here. Try running them in a very small test project. If that doesn't work, reinstal Lite-C.

Re: Unable to define new struct [Re: Excessus] #136954
06/18/07 22:45
06/18/07 22:45
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
make sure the file you're compiling is a .c, not a .wdl.

aside from that, i'm at a loss as to what can be causing your problem.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: Unable to define new struct [Re: JibbSmart] #136955
06/20/07 06:54
06/20/07 06:54
Joined: Jul 2005
Posts: 34
Hong Kong
U
ultranet Offline
Newbie
ultranet  Offline
Newbie
U

Joined: Jul 2005
Posts: 34
Hong Kong
typedef struct SPACESHIP{
var x;
} SPACESHIP;

It is totally correct. And I have test it and run normally.

Re: Unable to define new struct [Re: ultranet] #136956
06/21/07 18:08
06/21/07 18:08
Joined: Jun 2007
Posts: 3
E
Ekar Offline OP
Guest
Ekar  Offline OP
Guest
E

Joined: Jun 2007
Posts: 3
JulzMighty had the problem pinned down. I was compiling a .wdl file.

I knew it was something silly. Those are normally the hardest problems to explain.

I appreciate everyone's help on this.

Re: Unable to define new struct [Re: Ekar] #136957
06/21/07 18:11
06/21/07 18:11
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Note that you can leave out the first name:

typedef struct {
var x;
} SPACESHIP;


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1