Skip to content

json.inc from sm-ext-json Still required for includes – but not mentioned in the readme #11

@StarterX4

Description

@StarterX4

The description says sm-ext-json is optional, but doesn't mention that it's include – json.inc is still required for the plugin compilation.

After I've got a compilation error:

SourcePawn Compiler 1.12.0.7196
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2024 AlliedModders LLC

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket.inc(7) : error 417: cannot read from file: "json"
     7 | #include <json>
---------^

1 Error.

I've tried changing #include to #tryinclude, thinking it could be a typo, but it only brought even more errors:

SourcePawn Compiler 1.12.0.7196
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2024 AlliedModders LLC

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/ws_client.inc(38) : error 139: could not find type "JSON"
    38 |   function void (WebSocket ws, const JSON data, int wireSize);
-----------^

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/ws_client.inc(128) : error 139: could not find type "JSON"
   128 |   public native void WriteJSON(const JSON data, JSON_WRITE_FLAG write_flg = JSON_WRITE_NOFLAG);
---------------------------------------^

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/ws_client.inc(128) : error 139: could not find type "JSON_WRITE_FLAG"
   128 |   public native void WriteJSON(const JSON data, JSON_WRITE_FLAG write_flg = JSON_WRITE_NOFLAG);
-------------------------------------------------------^

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/http.inc(44) : error 139: could not find type "JSON"
    44 |   public native bool PostJson(const JSON json, ResponseCallback fResponse, any value = 0);
--------------------------------------^

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/http.inc(65) : error 139: could not find type "JSON"
    65 |   public native bool PutJson(const JSON json, ResponseCallback fResponse, any value = 0);
-------------------------------------^

/home/starterx4/Pulpit/gity/Kether.pl-L4D2-Server/addons/sourcemod/scripting/include/websocket/http.inc(76) : error 139: could not find type "JSON"
    76 |   public native bool PatchJson(const JSON json, ResponseCallback fResponse, any value = 0);
---------------------------------------^

6 Errors.

So it was inevitable to add that include to compile my plugin successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions