Raised This Month: $51 Target: $400
 12% 

Solved Working with multiple files


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 08-21-2017 , 05:18   Working with multiple files
Reply With Quote #1

Hello, so I'm trying to learn how to work with multiple files to clean up my projects a bit.

My first test was to have every command in its own file.

When trying to compile I get an error, because it tries to fetch a prefix-variable that's stated in the main file. It tells me that the prefix variable is an undefined symbol.

So the bottom-line question is this: Can my secondary files not access variables and such that's stated in the main file?
Is there a way to work around this?

I also have global forwards that executes on some commands so I basically need it work somehow
__________________

Last edited by condolent; 08-21-2017 at 06:21.
condolent is offline
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
Old 08-21-2017 , 06:16   Re: Working with multiple files
Reply With Quote #2

put your #include after the global variables in your main file
__________________
Github: https://github.com/jimppan
Steam: http://steamcommunity.com/id/jimppan
_____________________________________________ _________
Taking private requests
Rachnus is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 08-21-2017 , 06:21   Re: Working with multiple files
Reply With Quote #3

Quote:
Originally Posted by Rachnus View Post
put your #include after the global variables in your main file
Ah, it was easy as that! Thanks! : )
__________________
condolent is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode