[Weird Issue] Why wouldn't a file be included into a compilation? Yet the files next to it are included...
#1

SOLVED. I found out exactly why this happens, check last post.


I've found two files in my include list not being included into the compilation.
The include list looks like this:

pawn Код:
#include "../scripts/SSS/Maps/gen_ls.pwn"
#include "../scripts/SSS/Maps/gen_sf.pwn"
#include "../scripts/SSS/Maps/gen_lv.pwn" // NOT INCLUDED
#include "../scripts/SSS/Maps/gen_red.pwn"
#include "../scripts/SSS/Maps/gen_flint.pwn"
#include "../scripts/SSS/Maps/gen_bone.pwn"
#include "../scripts/SSS/Maps/gen_rob.pwn" // NOT INCLUDED
The contents of each file is just a single function named "LoadGen_#()" with '#' following the file name convention (so inside "gen_ls.pwn" the function is "LoadGen_LS();") like this:

pawn Код:
LoadGen_LS()
{
}
EVERY file is the same, for the purpose of debugging I removed the entire file contents of each file so each is left with a blank function. The functions are called from OnGameModeInit UNDERNEATH the includes, but obviously as the two aren't included they have "Undefined symbol" errors for the "LoadGen_" functions.

I even put a '#error' line inside the files to see if they were included but no compiler errors on those two files.
There isn't even a "fatal error 100: cannot read from file:" error on the compilation on those two files, yet if I alter the other include lines slightly it pops up with that error.


Why is this happening? Is it the file names? I changed from a mix of cases to all lower case, I also deleted the files and created new ones and still just those two files named gen_lv.pwn and gen_rob.pwn aren't included. I'm compiling this on windows and running it on the same PC.
Reply
#2

Sometimes the compiler fails to include the file if the path length is longer than X amount of characters. Sadly I don't remember how many. This seems to be some kind of bug.
Reply
#3

Hmm, I was wondering if it was that but there are files with far longer directories included and they work fine.

I switched all to lowercase and removed the _ from the filenames, it worked but I still don't understand why as I have many other files with _ in the name...
Reply
#4

Update: I thought I'd double post just in case Vince was wondering and so anyone else who might have the same problem wants to know why.


It turns out, after some testing, if you name an include the same as a variable or function or public callback in your script it just refuses to read the file. It also only seems to happen if that file is inside another directory.

Even if the file doesn't exist this happens, so if I just wrote #include "../scripts/Main/NonExistent.pwn" and named a variable "NonExistent" I wouldn't even see the "Fatal error: file not found" error on compiling.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)