Aller au contenu

Photo

Writing Include Files


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Wannabeuk

Wannabeuk
  • Members
  • 58 messages
Could anyone tell me how to write an include script. whenever i try i get errors about not having a main or starting conditional. ive looked at the bioware includes and they certainly dont have these.

Am i missing a trick here?

#2
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Try putting all function prototypes at the beginning of the file.
ie:

if you have a function defined like this:

int sum (int a, int b, int c)
{
return a+b+c;
}

put the first line right at the top of the file so it would look something like this:

int sum (int a, int b, int c);

int sum (int a, int b, int c)
{
return a+b+c;
}

Modifié par ChewyGumball, 10 novembre 2009 - 06:07 .


#3
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Also you don't compile include files independently...they won't compile on their own as you have seen. They get compiled when you compile all those scripts which use the library via a #include line.


#4
Wannabeuk

Wannabeuk
  • Members
  • 58 messages
Ah right, thanks guys i was worried because obviously it compiles the script everytime you save it and throws up that error.



Thanks for the assist :)