View Single Post
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 11-10-2014 , 01:04   Re: [TUTORIAL] Writing an Extension (AMX Mod X Module) + Screenshots [May 15, 2014]
Reply With Quote #25

Hello guys.

Windows posibble compiling .so modules? How to, i get this error:


Edit:

Next try:

Code:
C:\Users\user\Downloads\kiki\kiki>gcc main.cpp sdk/amxxmodule.cpp main.h c
hooker.h -Isdk -Imod/metamod/metamod -Imod/hlsdk/public -Imod/hlsdk/pm_share -Im
od/hlsdk/dlls -Imod/hlsdk/engine -Imod/hlsdk/common -shared -o test.so
In file included from main.cpp:4:0:
sdk/amxxmodule.h:97:35: error: conflicting declaration 'typedef long int int32_t
'
         typedef long int          int32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from main.cpp:4:
c:\mingw\include\stdint.h:31:14: error: 'int32_t' has a previous declaration as
'typedef int int32_t'
 typedef int  int32_t;
              ^
In file included from main.cpp:4:0:
sdk/amxxmodule.h:98:35: error: conflicting declaration 'typedef long unsigned in
t uint32_t'
         typedef unsigned long int uint32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from main.cpp:4:
c:\mingw\include\stdint.h:32:20: error: 'uint32_t' has a previous declaration as
 'typedef unsigned int uint32_t'
 typedef unsigned   uint32_t;
                    ^
In file included from main.cpp:5:0:
chooker.h: In member function 'void* CMemory::SearchSymbolByAddress(char*, void*
)':
chooker.h:390:95: error: 'GetModuleHandleEx' was not declared in this scope
     if( GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, ( LPCSTR )li
baddr, &module ) )

               ^
chooker.h:392:47: error: invalid conversion from 'FARPROC {aka int (__attribute_
_((__stdcall__)) *)()}' to 'void*' [-fpermissive]
      void* s = GetProcAddress( module, symbol );
                                               ^
chooker.h: In member function 'void* CMemory::GetLibraryFromAddress(void*)':
chooker.h:437:95: error: 'GetModuleHandleEx' was not declared in this scope
     if( GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, ( LPCSTR )li
baddr, &module ) )

               ^
In file included from sdk/amxxmodule.cpp:40:0:
sdk/amxxmodule.h:97:35: error: conflicting declaration 'typedef long int int32_t
'
         typedef long int          int32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from sdk/amxxmodule.cpp:40:
c:\mingw\include\stdint.h:31:14: error: 'int32_t' has a previous declaration as
'typedef int int32_t'
 typedef int  int32_t;
              ^
In file included from sdk/amxxmodule.cpp:40:0:
sdk/amxxmodule.h:98:35: error: conflicting declaration 'typedef long unsigned in
t uint32_t'
         typedef unsigned long int uint32_t;
                                   ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\stdint.h:9:0,
                 from c:\mingw\include\process.h:18,
                 from c:\mingw\include\unistd.h:13,
                 from mod/metamod/metamod/osdep.h:230,
                 from mod/metamod/metamod/dllapi.h:41,
                 from mod/metamod/metamod/meta_api.h:40,
                 from sdk/amxxmodule.h:17,
                 from sdk/amxxmodule.cpp:40:
c:\mingw\include\stdint.h:32:20: error: 'uint32_t' has a previous declaration as
 'typedef unsigned int uint32_t'
 typedef unsigned   uint32_t;
                    ^
main.h:26:2: error: unknown type name 'bool'
  bool isBot;
  ^
main.h:27:2: error: unknown type name 'bool'
  bool inGame;
  ^
main.h:34:85: warning: 'struct sockaddr' declared inside parameter list [enabled
 by default]
 typedef size_t ( PASCAL *Func_Sendto )( int, const void*, size_t, int, const st
ruct sockaddr*, socklen_t );

     ^
main.h:34:85: warning: its scope is only this definition or declaration, which i
s probably not what you want [enabled by default]
main.h:36:100: warning: 'struct sockaddr' declared inside parameter list [enable
d by default]
 size_t PASCAL OnNewSendto( int socket, const void* message, size_t length, int
flags, const struct sockaddr* dest_addr, socklen_t dest_len );

                    ^
main.h:38:1: error: unknown type name 'bool'
 bool hookSendto  ( void );
 ^
main.h:40:1: error: unknown type name 'bool'
 bool messageGetString( const unsigned char* &msg, size_t &len, char* name, int
nlen );
 ^
main.h:40:45: error: expected ';', ',' or ')' before '&' token
 bool messageGetString( const unsigned char* &msg, size_t &len, char* name, int
nlen );
                                             ^
main.h:42:1: error: unknown type name 'bool'
 bool isBot   ( edict_t* pEntity );
 ^
main.h:42:16: error: unknown type name 'edict_t'
 bool isBot   ( edict_t* pEntity );
                ^
chooker.h:136:1: error: unknown type name 'class'
 class CMemory
 ^
chooker.h:137:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
chooker.h:541:1: error: unknown type name 'class'
 class CFunc
 ^
chooker.h:542:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
chooker.h:646:1: error: unknown type name 'class'
 class CHooker
 ^
chooker.h:647:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
 {
 ^
why the problem?
Attached Images
File Type: jpg compileerror.JPG (44.5 KB, 167 views)
__________________

Last edited by kiki33hun; 11-10-2014 at 08:31.
kiki33hun is offline