Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] A weird problem with includes

 
  • 0 Vote(s) - 0 Average
Pawn A weird problem with includes
mouiz
Offline

Burgershot Member
Posts: 27
Threads: 11
Joined: May 2019
Reputation: 0
#1
2019-07-14, 01:00 PM
Quote:#include <../../gamemodes/modes/mode_robbery.pwn>
#include <../../gamemodes/modes/mode_dogfight.pwn>

These are ^ two includes in the 'gamemodes/modes' folder.


If i arrange them like this: 

Quote:#include <../../gamemodes/modes/mode_dogfight.pwn>
#include <../../gamemodes/modes/mode_robbery.pwn>

the 'mode_dogfight' works (gets included) and the second one is ignored (it shows undefined symbol errors since the definitions of the functions are in the include)

If i arrange them oppositely then the 'mode_robbery' works, the second one is ignore.

How can i fix this?
Manyula
Offline

Burgershot Member
Posts: 52
Threads: 5
Joined: Apr 2019
Reputation: 5
Location: Germany
#2
2019-07-14, 01:22 PM
Try using

Code:
#include "..."

instead of

Code:
#include <...>
mouiz
Offline

Burgershot Member
Posts: 27
Threads: 11
Joined: May 2019
Reputation: 0
#3
2019-07-14, 01:29 PM (This post was last modified: 2019-07-14, 01:30 PM by mouiz.)
Does not work either way :/
mouiz
Offline

Burgershot Member
Posts: 27
Threads: 11
Joined: May 2019
Reputation: 0
#4
2019-07-14, 01:34 PM
When i put the 'mode_dogfight.pwn' in the pawno > include folder and change the path in the script, it works but i want it to be in the gamemodes folder...
Freaksken
Offline

open.mp Developer

Posts: 80
Threads: 4
Joined: Feb 2019
Reputation: 6
Location: Belgium
#5
2019-07-14, 03:12 PM (This post was last modified: 2019-07-14, 03:55 PM by Freaksken.)
The updated version of the compiler fixes that problem:
https://github.com/pawn-lang/compiler/releases

You can read more about the fix here:
https://github.com/pawn-lang/compiler/wiki/File-Inclusion#long-paths
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#6
2019-07-14, 03:55 PM
Also, use \ not /
mouiz
Offline

Burgershot Member
Posts: 27
Threads: 11
Joined: May 2019
Reputation: 0
#7
2019-07-14, 04:51 PM
Ok, thanks both
dakyskye
Offline

open.mp Developer

Posts: 25
Threads: 4
Joined: Feb 2019
Reputation: 2
Location: Georgia
#8
2019-07-17, 07:48 PM (This post was last modified: 2019-07-17, 07:49 PM by dakyskye.)
That's because you are on Windows and use wrong directory separator. On Windows, it is \  while on Unix and unix-like systems it's /
A trick: always use \ even while not on Windows and compile with -Z+ which is for compatibility and changes \ to / automatically on non-Windows platforms.
@dakyskye everywhere
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode