SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 12/01/2019, 06:24 PM   #51
[HLF]Southclaw
Godfather
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 5,018
Reputation: 1598
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Hi, apologies for the late reply!

I've been seeing this problem reported recently, I have no idea it's only coming up recently but it is. And I have no idea what the cause is. Missing libraries should throw a Windows dialog box but maybe the programming language that sampctl is written in doesn't provide that interface.

You can debug this a little easier by doing the following:

1. Run your sampctl command with `--verbose` at the end, for example: `sampctl package build --verbose`
2. At the very end of the (long) output, there will be the following message:

Code:
INFO: executing compiler in DIRECTORY as [ENV] [COMMAND]
It's the COMMAND bit you're interested in, in the second set of square brackets. This output will be very long so it's probably best to copy the *entire* thing into Sublime text or an editor of your choice. Remember that there will be a ] at the very end of the command that you must also remove.

Once you've got the command, it should look something like this:

Code:
C:/Users/YOURNAME/.samp/pawn/3.10.4/pawncc.exe C:/SERVER_DIRECTORY/gamemodes/barp.pwn -DC:/SERVER_DIRECTORY/gamemodes -oC:/SERVER_DIRECTORY/gamemodes/barp.amx -d3 -;+ -(+ -\+ -Z+ -iC:/SERVER_DIRECTORY/some-include-directory
(Yours will likely be longer, this is just a demonstration, you should have a general idea of what to look for)

Now, you need to run this command on your shell. You should use PowerShell and I will assume Windows here (If you're a Linux or Mac user, reply and I will update this post with an example for your OS). You will need to escape the special characters used for all the flags that are passed to the compiler, this involves enclosing them in ' characters, like so:

Code:
C:/Users/YOURNAME/.samp/pawn/3.10.4/pawncc.exe C:/SERVER_DIRECTORY/gamemodes/barp.pwn -DC:/SERVER_DIRECTORY/gamemodes -oC:/SERVER_DIRECTORY/gamemodes/barp.amx '-d3' '-;+' '-(+' '-\+' '-Z+' -iC:/SERVER_DIRECTORY/some-include-directory
Now, run the command in PowerShell and you should see the raw output from the process which will help you (and me!) debug this problem and locate the source.

-

Side notes:

- I plan to make this debugging technique easier in sampctl by outputting a pre-formatted command based on the OS that you can simply copy directly off the command line and execute.
- I also plan to somehow expose the pawncc.exe output to sampctl's standard out while in verbose mode to also capture issues related to arguments.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 15/01/2019, 11:32 AM   #52
Manyula
Huge Clucker
 
Manyula's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 290
Reputation: 47
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

I've got following output:

Code:
In line:1 character:273
+ ... \PawnProjects\sa-mp-gamemode\gamemodes\main.amx -d3 -;+ -(+ -\+ -Z+ - ...
+                                                                  ~
Expression is missing after the unary operator "-".
In line:1 character:273
+ ... awnProjects\sa-mp-gamemode\gamemodes\main.amx -d3 -;+ -(+ -\+ -Z+ -iC ...
+                                                                ~~
Unexpected token "\+" in expression or statement.
In line:1 character:273
+ ... \PawnProjects\sa-mp-gamemode\gamemodes\main.amx -d3 -;+ -(+ -\+ -Z+ - ...
+                                                                  ~
Closing ")" is missing in an expression.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingExpressionAfterOperator
__________________
Manyula is offline   Reply With Quote
Old 15/01/2019, 05:47 PM   #53
[HLF]Southclaw
Godfather
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 5,018
Reputation: 1598
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

You need to enclose all the arguments in ' characters, for example, this:

Code:
-d3 -;+ -(+ -\+ -Z+
should be

Code:
'-d3' '-;+' '-(+' '-\+' '-Z+'
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 15/01/2019, 06:33 PM   #54
Manyula
Huge Clucker
 
Manyula's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 290
Reputation: 47
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Thanks for your help!

In my pawn.json file, I changed...

Code:
"builds": [
    {
        "name": "main",
        "includes": [
            "legacy"
        ]
    }
]
to...

Code:
"builds": [
    {
        "name": "main",
        "version": "3.10.8",
        "includes": [
            "legacy"
        ]
    }
]
Compilation on version 3.10.8 works (the latest 3.10.9 spits out a bunch of warnings if you're using YSI). Version 3.10.4 which is automatically downloaded when creating a new package does not work.
__________________
Manyula is offline   Reply With Quote
Old 16/01/2019, 05:48 AM   #55
[HLF]Southclaw
Godfather
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 5,018
Reputation: 1598
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Good to hear!

Those warnings are const correctness warnings which are pointing out potential bugs in code, more information: https://github.com/pawn-lang/compile...st-correctness

And what exactly isn't working with 3.10.4? That version hasn't been changed as far as I know and it's the default because it was the most stable for a long time.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 16/01/2019, 09:04 AM   #56
Manyula
Huge Clucker
 
Manyula's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 290
Reputation: 47
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Quote:
Originally Posted by [HLF]Southclaw View Post
And what exactly isn't working with 3.10.4? That version hasn't been changed as far as I know and it's the default because it was the most stable for a long time.
I have no idea. PowerShell doesn't give me any output after running the COMMAND.

v3.10.4
Code:
PS C:\Users\MyUser> C:\Users\MyUser\.samp\pawn\3.10.4\pawncc.exe C:\Users\MyUser\Desktop\Test\test.pwn -DC:\Users\MyUser\Desktop\Test -oC:\Users\MyUser\Desktop\Test\test.amx '-d3' '-;+' '-(+' '-\+' '-Z+' -iC:\Users\MyUser\Desktop\Test\dependencies\samp-stdlib -iC:\Users\fabib\Desktop\Test\dependencies\pawn-stdlib
PS C:\Users\MyUser>
v3.10.8
Code:
C:\Users\MyUser\.samp\pawn\3.10.8\pawncc.exe C:\Users\MyUser\Desktop\Test\test.pwn -DC:\Users\MyUser\Desktop\Test -oC:\Users\MyUser\Desktop\Test\test.amx '-d3' '-;+' '-(+' '-\+' '-Z+' -iC:\Users\MyUser\Desktop\Test\dependencies\samp-stdlib -iC:\Users\MyUser\Desktop\Test\dependencies\pawn-stdlib
Pawn compiler 3.10.8                    Copyright (c) 1997-2006, ITB CompuPhase

Header size:            104 bytes
Code size:                8 bytes
Data size:                0 bytes
Stack/heap size:      16384 bytes; estimated max. usage=11 cells (44 bytes)
Total requirements:   16496 bytes
__________________
Manyula is offline   Reply With Quote
Old 21/02/2019, 09:49 AM   #57
ComDuck
Big Clucker
 
ComDuck's Avatar
 
Join Date: Feb 2019
Posts: 81
Reputation: 12
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Just want to add on more to the error:

Code:
failed to compile package entry: exit status 3221225781
If running the compilation command through PowerShell returns nothing, then try running the same command in Command Prompt. If you have any dependency issues (missing Visual C++ redistributables), an error will be shown.
ComDuck is offline   Reply With Quote
Old 21/02/2019, 10:52 AM   #58
Manyula
Huge Clucker
 
Manyula's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 290
Reputation: 47
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Quote:
Originally Posted by ComDuck View Post
Just want to add on more to the error:

Code:
failed to compile package entry: exit status 3221225781
If running the compilation command through PowerShell returns nothing, then try running the same command in Command Prompt. If you have any dependency issues (missing Visual C++ redistributables), an error will be shown.
That was really helpful, thanks! I got an error telling me the "MSVCR120.dll" was missing. That DLL is part of the Microsoft Visual C++ 2013 Redistributable Package. I only had the x64 version installed. I installed the x86 version and now it works. Higher versions of the compiler seem to be using the 2017 redistributable package.
__________________
Manyula is offline   Reply With Quote
Old 21/02/2019, 11:16 AM   #59
ComDuck
Big Clucker
 
ComDuck's Avatar
 
Join Date: Feb 2019
Posts: 81
Reputation: 12
Default Re: sampctl: The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer

Quote:
Originally Posted by Manyula View Post
That was really helpful, thanks! I got an error telling me the "MSVCR120.dll" was missing. That DLL is part of the Microsoft Visual C++ 2013 Redistributable Package. I only had the x64 version installed. I installed the x86 version and now it works. Higher versions of the compiler seem to be using the 2017 redistributable package.
Glad to hear you got it worked out, I had the same issue a few hours ago. I'm not sure why PS does not report the error, though.

Quote:
Originally Posted by [HLF]Southclaws
Missing libraries should throw a Windows dialog box but maybe the programming language that sampctl is written in doesn't provide that interface.
ComDuck is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] Developer's swiss knife therainycat Tools and Files 29 18/09/2015 04:09 PM
[AJUDA]Perdendo vital ao decorrer do tempo vitorpedro PortuguÍs/Portuguese 7 03/10/2011 03:55 PM
Server owner resources: client management tools kaisersouse Server Support 20 29/12/2009 09:58 PM


All times are GMT. The time now is 06:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.