• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] I get error 021 using y_hooks
#1
Code:
Pawn compiler 3.10.10                  Copyright (c) 1997-2006, ITB CompuPhase

Modules/Worlds/Code.pwn(3) : error 021: symbol already defined: "_@yHOnDialogResponse@000"
Modules/Worlds/Code.pwn(3) : error 021: symbol already defined: "@yH_OnDialogResponse@000"
Modules/Worlds/Code.pwn(3) : error 021: symbol already defined: "@yH_OnDialogResponse@000"
Modules/Worlds/Code.pwn(3) : fatal error 107: too many error messages on one line

Compilation aborted.


I am developing a modular code that requires quite a few files, I wanted to simplify things further by using y_hooks since after reading the documentation I knew that was what I needed.

However I'm getting these errors, I've searched for information on some forums and in the y_hooks documentation, I've tried everything I can but this is the first time I've developed modular code of this style and used y_hooks on this scale, so I really don't know what I'm doing wrong.

I preferred to share this code where I replicate the problem so as not to extend myself so much talking.

  • gamemodes/GM.pwn (Main file)

Code:
#include <a_samp>

#include "Modules/Codes.pwn"

main() {
    return true;
}

  • gamemodes/Modules/Codes.pwn

Code:
#include "Modules/Users/Code.pwn"
#include "Modules/Worlds/Code.pwn"

  • gamemodes/Modules/Users/Code.pwn

Code:
#include <YSI_Coding/y_hooks>

hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    return true;
}

  • gamemodes/Modules/Worlds/Code.pwn

Code:
#include <YSI_Coding/y_hooks>

hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    return true;
}

  • I tried including y_hooks at the end of all Code.pwn files.
  • I tried including y_hooks only in the main file after including Codes.pwn.
  • I tried including y_hooks in Codes.pwn and in all Code.pwn files (at the end and at the beginning of the files)
  • I tried including y_hooks only in Codes.pwn (at the end and at the beginning of the file).

I think I also tried other ways of including y_hooks but it took me a few hours until I gave up and decided to turn to you guys... I hope you can help me solve the problem and I will appreciate if I can figure this out and learn more about y_hooks.
  Reply


Messages In This Thread
I get error 021 using y_hooks - by daniscript18 - 2024-11-18, 11:34 PM

Forum Jump: