SA-MP Forums Archive
Weird #include bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weird #include bug (/showthread.php?tid=263746)



Weird #include bug - Scottas - 23.06.2011

pawn Код:
//  Failas su funkcijomis
#include        "../filterscripts/Debug/debug_functions.pwn"
//  Transporto priemoniш rinkimasis
#include        "../filterscripts/Debug/debug_vehicles.pwn"
//  Instaliacijos failas    ( reikalingas tik tuomet, kai /scriptfiles/ kataloge nлra fs_debug.db failo )
#tryinclude     "../filterscripts/Debug/debug_install.pwn"

#if !defined VEHICLES
    #error NOT INCLUDED
#endif
Only the first file is checked and included. Even if files debug_vehicles ok debug_install doesn't exist, compiler shows no error or warning. file 'debug_functions' contains only variable, function and define.


Re: Weird #include bug - Wesley221 - 23.06.2011

An include must have the extension " .inc" and not " .pwn". Try to change it to .inc and try it again


Re: Weird #include bug - [HiC]TheKiller - 23.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
An include must have the extension " .inc" and not " .pwn". Try to change it to .inc and try it again
That's totally incorrect. You can include .pwn files like that.

OT: Make sure that you are not doubling up on functions which makes the compiler screw itself over for some reason. Make sure you only have one of each callback throughout all your scripts.


Re: Weird #include bug - Scottas - 23.06.2011

Well, everything looks allright, here files:


Re: Weird #include bug - Sasino97 - 23.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
An include must have the extension " .inc" and not " .pwn". Try to change it to .inc and try it again
#include can include all files, for example YSI includes .own files


Re: Weird #include bug - Scottas - 23.06.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
You are using "#tryinclude", which means that the compiler won't display a warning if the file doesn't exist - it is doing exactly what you asked it to!
I know, but compiler doesn't display a warning if file 'debug_vehicles' is missing, which is included in that way:

pawn Код:
#include        "../filterscripts/Debug/debug_vehicles.pwn"
debug_install is not included too, but it should be included. If I change code a little bit, like this:
pawn Код:
//  Instaliacijos failas    ( reikalingas tik tuomet, kai /scriptfiles/ kataloge nėra fs_debug.db failo )
#tryinclude     "../filterscripts/Debug/debug_install.pwn"
//  Failas su funkcijomis
#include        "../filterscripts/Debug/debug_functions.pwn"
//  Transporto priemonių rinkimasis
#include        "../filterscripts/Debug/debug_vehicles.pwn"
Then compiler includes file 'debug_install', but doesn't include next two, and doesn't show any error or warning. It checks only first include and ignores next includes.


Re: Weird #include bug - Scottas - 25.06.2011

Up again


Re: Weird #include bug - Scottas - 29.06.2011

Sorry, but I need to know whats wrong, up


Re: Weird #include bug - Scottas - 07.07.2011

Sorry for another post, but I want to tell, that I've get rid of this problem . Strange, I've only renamed files ( deleted 'debug_' part ), and everything works fine now .