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
1 registered members (TipmyPip), 18,619 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
Header and source file includes #419742
03/14/13 05:10
03/14/13 05:10
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline OP
Member
Arrovs  Offline OP
Member

Joined: Apr 2006
Posts: 159
Latvija
Hello fellow programmers.
Im a bit confused about this:

mycode.h:
function call_function();

mycode.c:
function call_function()
{
return 1;
}

main.c:
#include "mycode.h"

function main()
{
var i = call_function();
}

So after testing how to implement good way to use header file im get a bit confused about linkage together. Running script results in empty call. So it isnt compiling mycode.c file.
Is there any solutions?

P.S. I want this so i could hide all file specific functions and variables.


Arrovs once will publish game
Re: Header and source file includes [Re: Arrovs] #419745
03/14/13 06:40
03/14/13 06:40
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
You need to include the c-file aswell.
You can do that in the header, or vise-versa.

Re: Header and source file includes [Re: Ch40zzC0d3r] #419747
03/14/13 07:53
03/14/13 07:53
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I prefer including all h-files and then all c-files in the main-file like:

Code:
#include "player.h"
#include "camera.h"
...

#include "player.c"
#include "camera.c"
...



If you do so you assure that in ALL your code files every function you declare in your h-files can be used.


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

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