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

Happy Holidays from the GTANet team!

[Plugin SDK] Compilation error


CharlesVercetti
 Share

Recommended Posts

CharlesVercetti

I've installed Code Blocks on my Windows & PC and made all the necessary adjustments to make a plugin(installing Plugin SDK requisites,etc..).

The problem is,whenever I try to compile a plugin(in which the c++ code has been correctly sourced under a Plugin SDK project),I get this following error.

||=== Build file: GTAVC Release in test (compiler: GNU GCC Compiler) ===|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h||In instantiation of 'static bool plugin::message_gen::msga(const char*, int, const char*, ArgTypes ...) [with ArgTypes = {char*, char*, const char*}]':|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h|48|required from 'bool plugin::Error(const char*, ArgTypes ...) [with ArgTypes = {char*, char*, const char*}]'|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\GameVersion.h|250|required from here|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h|19|error: 'sprintf_s' was not declared in this scope|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h||In instantiation of 'static bool plugin::message_gen::msga(const char*, int, const char*, ArgTypes ...) [with ArgTypes = {const char*}]':|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h|40|required from 'bool plugin::Message(const char*, ArgTypes ...) [with ArgTypes = {const char*}]'|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\GameVersion.h|257|required from here|C:\Users\Abu\Desktop\storieshud_src\plugin-sdk\shared\Error.h|19|error: 'sprintf_s' was not declared in this scope|||=== Build failed: 2 error(s), 6 warning(s) (0 minute(s), 5 second(s)) ===|

Can anyone help? (Forget about the folder path,that's totally irrelevant)

Link to comment
Share on other sites

Have you completely followed this guide when installing Code::Blocks?

  • Like 2
Link to comment
Share on other sites

this plug-in more dedicated to visual studio
I also have this problem only I have 50 mistakes

  • Like 1
Link to comment
Share on other sites

CharlesVercetti

Have you completely followed this guide when installing Code::Blocks?

I installed Code Blocks which was bundled with the mingw compiler.

Capture.png

Does this cause any problem?

Link to comment
Share on other sites

Yes, because mingw32 and mingw-w64 are different compiler versions.

Edited by DK22Pac
Link to comment
Share on other sites

CharlesVercetti

Yes, because mingw32 and mingw-64 are different compiler versions.

Thanks for the help _DK.(The offline installable .7z file is available for rev0 only.Online installer keeps crashing)

Another question-how do I link the source code of your mobile HUD with the plugin sdk snd compile it?

I am continuously getting the "missing plugin.h" error.

Edited by CharlesVercetti
Link to comment
Share on other sites

First you need to download MobileHUD source (you can find it on github) and put it to some X folder.

Then create a new plugin-sdk project in Code::Blocks, set its location at X folder.

And then, add all MobileHUD source files to your project.

  • Like 1
Link to comment
Share on other sites

CharlesVercetti

Yes, because mingw32 and mingw-w64 are different compiler versions.

Yupp...mingw64 has compiled the code successfully.But It seems I can't build a plugin.

||=== Build: GTAVC Release in chhudcol (compiler: GNU GCC Compiler) ===|ld.exe||cannot find -lplugin_vc|||error: ld returned 1 exit status|||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Edited by CharlesVercetti
Link to comment
Share on other sites

Like this?

No. You've created your project inside plugin-sdk workspace, which is not how you should do it.

After you cloned/updated your plugin-sdk copy, open it and build, and you can close it and 'forget' about it (until another sdk update).

So when you've built a plugin-sdk workspace, you can close it and create your own plugin.

That's how a 'clean' plugin project looks like:

 

hlIyYNVm.png

Edited by DK22Pac
Link to comment
Share on other sites

CharlesVercetti

That's how a 'clean' plugin project looks like:

hlIyYNVm.png

 

I did as you specified..but stlll the same error persists. :dontgetit:

Capture.png

ld.exe||cannot find -lplugin_vc|||error: ld returned 1 exit status|
Link to comment
Share on other sites

Check if this file exists:

 

plugin-sdk\output\mingw\lib\libplugin_vc.a
If it doesn't - try to build plugin-sdk again. Maybe there were some errors during a build? Edited by DK22Pac
  • Like 1
Link to comment
Share on other sites

CharlesVercetti

Check if this file exists:

 

plugin-sdk\output\mingw\lib\libplugin_vc.a
If it doesn't - try to build plugin-sdk again. Maybe there were some errors during a build?

That worked like a charm.Thank you _DK !

Link to comment
Share on other sites

  • 2 weeks later...

What about VS2017 ?

 

How to import project from GitHub ?

 

(I've already built plugin-sdk...and forgot it, as you said).

 

Any sugestion for a beginner ? maybe tweak an existent project !

 

(my C experience comes from ARM - using IAR not Visual Studio, my last C++ program was for Win 3.11 :blush: - yes....I'm old as hell )

 

I have this so far :

 

21jU8kI.png

Edited by pep legal
Link to comment
Share on other sites

is it ok to take more time on code blocks to compile than vs?Its not that much but slightly?

Link to comment
Share on other sites

What about VS2017 ?

The route for VS is almost same as for CodeBlocks. And if you already have a created project - what's the problem then?

 

 

How to import project from GitHub ?

If a project is made for VS, you can clone the repo and simply open the .sln file.

As another option, you can use Github Extension for VS, click on "Open in Visual Studio" button on GitHub:

CM5dCML.png

 

https://docs.microsoft.com/en-us/visualstudio/ide/develop-code-in-visual-studio-without-projects-or-solutions

https://docs.microsoft.com/en-us/vsts/git/tutorial/clone?view=vsts&tabs=visual-studio

 

 

Any sugestion for a beginner ? maybe tweak an existent project !

You can check our examples in 'plugin-sdk/examples' folder.

 

 

is it ok to take more time on code blocks to compile than vs?Its not that much but slightly?

Code::Blocks and Visual Studio use completely differnt building toolchain, so I think it's normal that we have different building time. Edited by DK22Pac
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.