Can't read from files.
#1

Hey. I got some problems with reading files and I don't know why that's happening.
I'll try to explain with example:

PHP код:
#include "data/some/other/folders/firstfile.pwn"
#include "data/some/other/folders/secondfile.pwn". 
First file content:
PHP код:
forward firstfilefunction();
public 
firstfilefunction()
{
   return 
1;

Second file content:
PHP код:
forward secondfilefunction();
public 
secondfilefunction()
{
   return 
1;

It doesn't shows any errors when including (I mean "can't read from file..."), but I can't use functions; f.e:
PHP код:
public OnGameModeInit()
{
   
firstfilefunction();
   
secondfilefunction();

It shows
Код HTML:
error 017: undefined symbol secondfilefunction()
.
When I switch these includes (first include "secondfile.pwn", then "firstfile.pwn") it shows
Код HTML:
error 017: undefined symbol firstfilefunction()
So what's happening
Reply
#2

An include path can be maximum 30-ish characters total length. If it's longer than that you will get weird bugs.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
An include path can be maximum 30-ish characters total length. If it's longer than that you will get weird bugs.
Thanks man, working now. But maybe it's possible to make the path working when it's longer the 30 chars ?
Reply
#4

Change the forward slashes to backward ones otherwise the include gets blocked by the include guard if the path is to long
Reply
#5

Thanks guys, everything works fine now L&A
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)