Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Compiler freaking out? Multiple source file help! #315380
03/15/10 02:58
03/15/10 02:58
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
Hi all,

I have A7 commercial, and I have built my first little test program. It's a cute little sucker, runs and compiles like a champ.

Now, starting a clean project, trying to re-write and clean up my old code, SED is giving me some just freaking weird crap.

Here's my main script:

#include <acknex.h>
#include <default.c>

function main()
{

PANEL* MainMenu =
{
MainMenu.pos_x = 0;
MainMenu.pos_y = 0;
MainMenu.layer = 1;
MainMenu.bmap = "blue8x8.tga";
MainMenu.flags = OVERLAY | SHOW;
}
////////////////////////////////////////////////////////////////////
/* Initialization */
////////////////////////////////////////////////////////////////////

// PlayerData Player1;

MainMenu.pos_x = 400;
MainMenu.pos_y = 300;

mouse_mode = 1;
video_mode = 7;

level_load("./resources/maps/FPSTest1.wmb");
////////////////////////////////////////////////////////////////////
// Main Loop
////////////////////////////////////////////////////////////////////
while(1)
{
if(key_esc)
break;

wait(1);
}
}

It tells me all of the MainMenu variables are "Keyword Unknown"?

I also had this code broken out into files, one for menus, one called stdafx.h (The Visual Studio habits die hard...) and I was getting some funky errors about the whole business.

The way it used to look was

stdafx.h included acknex.h and default.c and Menusystem.h (my header), which originally tried to declare the following:

typedef struct MenuSystem
{
PANEL* MainMenu;
}MenuSystem;

However, when I did that, it would run, just not work, and I'd get error E1513 when I tried to use the struct.

Does SED have something like Clean & Rebuild That forcibly recompiles all files from scratch or does it just not like multiple files?

Re: Compiler freaking out? Multiple source file help! [Re: v3c7r0n] #315399
03/15/10 08:37
03/15/10 08:37
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
EDIT: Oups, sorry Warez user, no support.

Last edited by Razoron; 03/15/10 08:38.
Re: Compiler freaking out? Multiple source file help! [Re: Razoron] #315401
03/15/10 08:50
03/15/10 08:50
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Jeez even warez users cannot read the manual it seems.

Re: Compiler freaking out? Multiple source file help! [Re: Xarthor] #315407
03/15/10 11:03
03/15/10 11:03
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
Actually, I do now legitimately own A7 and will happily prove it. And yes, I did read the manual, Xarthor. Other projects I have built with multiple source files worked fine, but this seems to have started recently.

Re: Compiler freaking out? Multiple source file help! [Re: v3c7r0n] #315409
03/15/10 11:07
03/15/10 11:07
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
define the panel outside of the main function.

Re: Compiler freaking out? Multiple source file help! [Re: TechMuc] #315410
03/15/10 11:08
03/15/10 11:08
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
I tried that, same result.

Re: Compiler freaking out? Multiple source file help! [Re: v3c7r0n] #315414
03/15/10 11:38
03/15/10 11:38
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
I fixed the issue with the code above not compiling, was an oversight on my part.

Re: Compiler freaking out? Multiple source file help! [Re: v3c7r0n] #315415
03/15/10 11:39
03/15/10 11:39
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
corrected code

Code:
#include <acknex.h>
#include <default.c>

PANEL* MainMenu = 
{
pos_x = 0;
pos_y = 0;
layer = 1;
flags = OVERLAY | SHOW;
}

function main()
{
////////////////////////////////////////////////////////////////////
/* Initialization	 */
////////////////////////////////////////////////////////////////////

//	PlayerData Player1;

MainMenu.pos_x = 400;
MainMenu.pos_y = 300;

mouse_mode = 1;
video_mode = 7;

level_load("./resources/maps/FPSTest1.wmb");
////////////////////////////////////////////////////////////////////
// Main Loop	
////////////////////////////////////////////////////////////////////
while(1)
{
if(key_esc)
break;

wait(1);
}
}



Re: Compiler freaking out? Multiple source file help! [Re: TechMuc] #315416
03/15/10 11:48
03/15/10 11:48
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
Indeed, thank you TechMuc. Any idea why it seems to have issues with putting PANEL* inside of a struct? Both of these are in a different source file now. The top works, but the struct does not compile

// works
PANEL* Menu =
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = "blue8x8.tga";
flags = OVERLAY | SHOW;
}

// Does not work
struct TestMenu
{
PANEL* Menu2 = // <---- Syntax error
{
pos_x = 750;
pos_y = 550;
layer = 1;
bmap = "blue8x8.tga";
flags = OVERLAY | SHOW;
}
};

Re: Compiler freaking out? Multiple source file help! [Re: v3c7r0n] #315418
03/15/10 12:12
03/15/10 12:12
Joined: Jan 2009
Posts: 19
CT, US
V
v3c7r0n Offline OP
warned - Warez
v3c7r0n  Offline OP
warned - Warez
V

Joined: Jan 2009
Posts: 19
CT, US
More interestingly, if I simplify the struct to just declare the panel

struct TestMenu
{
PANEL* Menu2;
};

It compiles, but once I include the file in my main.c, it comes back as unidentified. If I typedef it, it's seen, and compiles, but I get a crash as soon as I try to use it

declaration:
typedef struct TestMenu
{
PANEL* Menu2;
};

Usage in main():
TestMenu Test;
Test.Menu2.pos_x = 750; // <- crash

I'm also noticing Lite-C here doesn't seem to have new & delete or malloc? I am guessing the PANEL* points to some random memory address (or NULL if lite-c defaults them to NULL), so I am guessing I will have to define another PANEL* somewhere, initialize it, and set Test.Menu2 to the panel I create?

Page 1 of 2 1 2

Gamestudio download | 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