Sloth- Posted March 31, 2018 Share Posted March 31, 2018 I've recently installed Code::Blocks with Plugin SDK. I'm compiling this script just to test. But when i move the asi file to my GTA SA folder, and i run, it shows an error message with something like this: "The program cannot start because libwinpthread-1.dll is missing. Reinstall the program to solve this problem." (not exactly because i'm translating from spanish). But after clicking on "Accept", gta_sa.exe starts normally, but script doesn't work (pressing F9 doesn't do anything). I also tried the same with this other script, but result is the same. I followed all steps in installation and setting guide in Plugin SDK github, i believe, but i'm obtaining this error. Help! Link to comment Share on other sites More sharing options...
Parik Posted April 1, 2018 Share Posted April 1, 2018 (edited) You need to put libwinpthread-1.dll from your MinGW installation folder/bin to wherever your plugin is. (GTA SA Folder) If you dont want to do that , see here Edited April 1, 2018 by Parik Sloth- 1 Link to comment Share on other sites More sharing options...
Sloth- Posted April 1, 2018 Author Share Posted April 1, 2018 (edited) Thank you! I moved libwinpthread-1.dll to my GTA SA folder, same as my asi. And error message doesn't appear anymore (later i will see how to make a static inclusion or something). But i have a new problem: my asi script doesn't do anything at all. I tested previous scripts and also this: Maybe i'm lacking something more? -------- EDIT: i don't know what happened, but after making the inclusion by adding this, as suggested in your link: the script finally worked! Thanks! Edited April 1, 2018 by Sloth- Parik 1 Link to comment Share on other sites More sharing options...
DK22Pac Posted April 2, 2018 Share Posted April 2, 2018 That's a strange behaviour for me. Did you install mingw-64 with these parameters? Also, the best way to check whether the plugin works or not will be: #include "plugin.h"struct Test { Test() { plugin::Message("Plugin loaded"); }} test; Sloth- 1 Link to comment Share on other sites More sharing options...
Sloth- Posted April 2, 2018 Author Share Posted April 2, 2018 That's a strange behaviour for me. Did you install mingw-64 with these parameters? I don't remember exactly how i configured, but more or less, this way: img: https://camo.githubusercontent.com/49f349ac6323342d2d0dbca439f5b27da2a702a2/68747470733a2f2f692e696d6775722e636f6d2f3541484c466c7a2e706e67 Everything equal to image. I had available version 7.3.0, and i think your link sugested taking most recent version, but i chosed 7.2.0, just to be sure to match the image. img: https://camo.githubusercontent.com/04de1d55a767cfb5dc2e1e6611578876ea6aa1d3/68747470733a2f2f692e696d6775722e636f6d2f51414b524737572e706e67 At installation i did not edited the destination folder (which is C:\Program Files (x86)\mingw-w64\i686-7.2.0-win32-sjlj-rt_v5-rev1). But when i saw next instruction, i did some changes: img: https://camo.githubusercontent.com/2cc0c13e04b4fec9713d8e427b6c056125923e81/687474703a2f2f692e696d6775722e636f6d2f70334f627a37552e706e67 This image suggest creating a system variable with path C:\Program Files (x86)\mingw-w64\mingw32\bin, but my instalation created the "bin" folder in C:\Program Files (x86)\mingw-w64\i686-7.2.0-win32-sjlj-rt_v5-rev1, not in C:\Program Files (x86)\mingw-w64\mingw32, so i had 2 options: change the path to C:\Program Files (x86)\mingw-w64\i686-7.2.0-win32-sjlj-rt_v5-rev1\bin, or move all content from "i686-7.2.0-win32-sjlj-rt_v5-rev1" to "mingw-w64" and leave C:\Program Files (x86)\mingw-w64\mingw32\bin as the path. I choosed last, but i think there would be no difference. Also, so i'm on Windows 7, the variables system windows looks like this and accept additional parameter that doesn't appear in your image: And this is how i cofigured the compiler part: By the way, currently i'm having trouble compiling a script that has Assembler: I've searched and looks like GCC compiler doesn't accept _asm { }, but instead another syntax. https://stackoverflow.com/questions/26373888/gcc-undeclared-identifier-asm https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html It seems the problem doesn't appear on Visual Studio. Link to comment Share on other sites More sharing options...
DK22Pac Posted April 3, 2018 Share Posted April 3, 2018 (edited) Okay, let's back to the stage when a compiled plugin didn't work for you. Please upload this plugin somewhere (also with C::B project and source files) and leave a link here. I choosed last, but i think there would be no difference.Yes. Also, that environment variable is not really necessary. It was such when we used our own tool for building projects (it used mingw binaries), but we don't use it anymore since we stopped support for VS2010-2013. i don't know what happened, but after making the inclusion by adding this, as suggested in your linkDoes it work if you only add -static? I've searched and looks like GCC compiler doesn't accept _asm { }, but instead another syntax.That's right. VS and GCC use different asm syntax. A fix for this problem in plugin-sdk would be... not using asm code at all, and using C++ code to manipulate registers and other low-level things. But that's just an idea for this time. Also, you can use intel syntax with gcc/mingw: -masm=intelBut you can't avoid gcc syntax for asm, generally: asm( "mov eax, eax;" "xor eax, eax;");And if you want a code to be compilable on VS, it'll look like this: #if (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__))asm( "mov eax, eax;" "xor eax, eax;");#else__asm { mov eax, eax xor eax, eax}#endif Edited April 3, 2018 by DK22Pac Sloth- 1 Link to comment Share on other sites More sharing options...
Sloth- Posted April 4, 2018 Author Share Posted April 4, 2018 (edited) Does it work if you only add -static? Not really, if i only add -static, and click on accept, then i check again the Project > Build Options > Linker Settings > Other Linker options, there is nothing, as if "-static" weren't accepted as a value. Also, if i put the "-static -lpthread" inside the Linker settings tab in "Global Compiler Settings", then i don't need to do that on every new plugin SDK project. #if (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__)) Awesome tip, thanks! Edited April 4, 2018 by Sloth- Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now