[C++ question] 'int32_t' redefinition
#1

Код:
#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'

Reply
#2

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
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)