Function not found using #include's


For readability in a fair big gamemode I've decided to split up all my functions etc, in different files as includes.

Now there's a function that it cannot find even though it is included.

Includes for the files.
pawn Код:
// Settings
#include <settings\variables>
#include <settings\config>
#include <settings\dialogs>

// Data
#include <data\common>
#include <data\datastructure>
#include <data\missions>
#include <data\dealerships>

// Functions
#include <functions\default>
#include <functions\loadall>
#include <functions\missions>
#include <functions\commands>
Function it cannot find:
C:\Users\Kevin\Dropbox\pawn\pawno\include\functions\ : error 017: undefined symbol "StartMission"
But what is weird is that it's just in the data\

pawn Код:
forward StartMission(playerid, type);
public StartMission(playerid, type)
So to make things a little more clear:

- data\missions is called before functions\commands.
- StartMission is forwarded as a function.

Any help would be greatly appreciated!

- Thanks for looking into it!

I think you will solve the problem if you use forward slashes '/' instead of back slashes
The reason is that the compiler prevents that you include the same filename "missions" again

Renamed the include and that worked, thanks alot!

On a side note thats a really bad code structure, You need to split your code by functionality, I.E house,job,vehicle,bizz and etc. not by their type as in data, functions, defines, variables.

So in your example you'd do it like this:

Houses ->,, etc,etc?

That could also be a structure. But it still is a personal matter on which you are the most comfortable with.

Thanks for the input though!

Ofc it's a personal choice to which you choose, but yeah the other way around would be actually both easier to read and solve problems on

This is my suggestion for you to try, this would be the structure of all individual systems in your files.
PHP код:
//defines n settings
//variables and static data arrays
//native callbacks
//custom callbacks

Forum Jump:

Users browsing this thread: 1 Guest(s)