Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[Code::Blocks / Plugin-SDK] missing "libwinpthread-1.dll"


Sloth-
 Share

Recommended Posts

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

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 by Parik
   

 

 

Link to comment
Share on other sites

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:

 

 

YgCU9yn.png

 

 

Maybe i'm lacking something more?

 

:cry:

 

--------

EDIT:

 

i don't know what happened, but after making the inclusion by adding this, as suggested in your link:

 

k2mAsGW.png

 

the script finally worked!

 

Thanks!

Edited by Sloth-
Link to comment
Share on other sites

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;
Link to comment
Share on other sites

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:

 

 

PgQy8Vc.png

 

 

And this is how i cofigured the compiler part:

 

 

ls9jEwD.png

 

 

 

By the way, currently i'm having trouble compiling a script that has Assembler:

 

 

UEaEBnI.png

 

 

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

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 link

Does 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=intel
But 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 by DK22Pac
Link to comment
Share on other sites

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! :happy:

Edited by Sloth-
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.