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,038 guests, and 6 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
Need some help on include & paths [solved] #405770
08/07/12 08:20
08/07/12 08:20
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hello,

My project consists of multiple scripts in multiple sub-folders.
But i need some help on how to set the include path right.

example:
main script includes a script in subfolder called "config.c".
Then config.c needs to include a script which is in another subfolder of the main work-folder.

How do i do this?


Last edited by peteredlin; 08/07/12 08:46.
Re: Need some help on include & paths [Re: peteredlin] #405771
08/07/12 08:26
08/07/12 08:26
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you need to setup the paths correctly
the preprocessor moves its current working path to the directory where the current file is
so all files referenced in main.c are relative paths to the folder where main.c is
all referenced files in config.c are relative to the folder of config.c

Code:
|- project folder
 |- main.c
 |- config files
  |- config.c
 |- player
  |- player.c
  |- enemy.c
  |- movement.c


(I hope this file system tree is clear enough)

to include all those files you write this:
Code:
// main.c:
#include "config files\config.c"
[...]

// config.c:
#include "..\player\player.c"
#include "..\player\enemy.c"
#include "..\player\movement.c"



with .. you can navigate to the containing folder, so "dev\pla\..\.." is the current directory wink


Visit my site: www.masterq32.de
Re: Need some help on include & paths [Re: MasterQ32] #405772
08/07/12 08:45
08/07/12 08:45
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Thanks for the speed-help!:)

Re: Need some help on include & paths [Re: peteredlin] #405775
08/07/12 09:24
08/07/12 09:24
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
no problem grin


Visit my site: www.masterq32.de

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