[C++ question] 'int32_t' redefinition - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [C++ question] 'int32_t' redefinition (
/showthread.php?tid=638622)
[C++ question] 'int32_t' redefinition -
Baltazar - 03.08.2017
Код:
#include <string>
#include "SDK/plugin.h"
Apparently plugin SDK is incompatible with the standard library. Any ideas on how to solve this plugin SDK problem?
Quote:
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdint.h(19): error C2371: 'int32_t': redefinition; different basic types
1> c:\users\[username]\documents\visual studio 2015\projects\[project]\resources\sdk\amx\amx.h(63): note: see declaration of 'int32_t'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdint.h(23): error C2371: 'uint32_t': redefinition; different basic types
1> c:\users\[username]\documents\visual studio 2015\projects\[project]\resources\sdk\amx\amx.h(64): note: see declaration of 'uint32_t'
|
Re: [C++ question] 'int32_t' redefinition -
jlalt - 03.08.2017
go to samp amx.h file and remove long from the definition of int32_t and uint32_t
PHP код:
typedef long int int32_t;
typedef unsigned long int uint32_t;
becomes ->
PHP код:
typedef int int32_t;
typedef unsigned int uint32_t;
Re: [C++ question] 'int32_t' redefinition -
Baltazar - 03.08.2017
Quote:
Originally Posted by jlalt
go to samp amx.h file and remove long from the definition of int32_t and uint32_t
|
Bad practice editing files, that were not written by me as I should probably make changes every time a new version comes out (unless a new version solves the problem of course).
Код:
#define HAVE_STDINT_H
#include "SDK/plugin.h"
It's written in
amx.h, that <stdint.h> gets included instead, but still getting the same errors :/ weird
_______________
EDIT: Ok, solved! Basically HAVE_STDINT_H should be defined before including plugin SDK