Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (93,052 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

Sign in to follow this  
CharlesVercetti

[Plugin SDK] Compilation error

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)

Share this post


Link to post
Share on other sites
DK22Pac

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

Share this post


Link to post
Share on other sites
Sanmodder

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
DK22Pac
Posted (edited)

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

Edited by DK22Pac

Share this post


Link to post
Share on other sites
CharlesVercetti
Posted (edited)

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

Share this post


Link to post
Share on other sites
DK22Pac

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.

Share this post


Link to post
Share on other sites
CharlesVercetti
Posted (edited)

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

Share this post


Link to post
Share on other sites
DK22Pac
Posted (edited)

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

Share this post


Link to post
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|

Share this post


Link to post
Share on other sites
DK22Pac
Posted (edited)

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

Share this post


Link to post
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 !

Share this post


Link to post
Share on other sites
pep legal
Posted (edited)

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

Share this post


Link to post
Share on other sites
Inan-Ahammad

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

Share this post


Link to post
Share on other sites
DK22Pac
Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

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