Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by JeyKey II. 10/22/26 07:33
Zorro tutorial ideas?
by mistery. 10/21/26 05:28
Avoid "log\ - delete old files" message
by Martin_HH. 10/20/26 07:23
Missing PnL files in zOpen child processes
by DonQuijote. 10/19/26 11:11
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (JeyKey II, ukgamer), 3,485 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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