Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, Ayumi), 702 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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