Raised This Month: $12 Target: $400
 3% 

Linux/ Centos 7 compiling module


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 08-31-2017 , 07:16   Linux/ Centos 7 compiling module
Reply With Quote #1

Hello! Can a module get compiled with gcc in Centos 7
__________________
ghost95v is offline
Send a message via Skype™ to ghost95v
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-31-2017 , 08:19   Re: Linux/ Centos 7 compiling module
Reply With Quote #2

Yes, the distribution shouldn't matter, GCC should work well on any distro.
klippy is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 08-31-2017 , 09:02   Re: Linux/ Centos 7 compiling module
Reply With Quote #3

So what command should i use to make a cpp file executable .so
For example this code


PHP Code:
#include "amxxmodule.h" 

#include <stdio.h> 
#include <string.h> 
#include <ctype.h> 

#if !defined __linux__ 
static signed int pread(signed int Numbervoid pBuffersize_t Countlong Offset

return (
lseek(NumberOffsetSEEK_SET) != Offset) ? ((signed int) (-1)) : ((signed int) (read(NumberpBufferCount))); 

#endif 

char replace(char const * const originalchar const * const patternchar const * const replacement

size_t const replen strlen(replacement); 
size_t const patlen strlen(pattern); 
size_t const orilen strlen(original); 

size_t patcnt 0
const 
char oriptr
const 
char patloc

for (
oriptr originalpatloc strstr(oriptrpattern); oriptr patloc patlen

patcnt++; 



size_t const retlen orilen patcnt * (replen patlen); 
char * const returned = (char *) mallocsizeof(char) * (retlen 1) ); 

if (
returned != NULL

char retptr returned
for (
oriptr originalpatloc strstr(oriptrpattern); oriptr patloc patlen

size_t const skplen patloc oriptr
strncpy(retptroriptrskplen); 
retptr += skplen
strncpy(retptrreplacementreplen); 
retptr += replen

strcpy(retptroriptr); 

return 
returned



send_intermissionAMX *, cell * ) 

MESSAGE_BEGINMSG_ALLSVC_INTERMISSION ); 
MESSAGE_END( ); 

return 
1

__________________
ghost95v is offline
Send a message via Skype™ to ghost95v
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-31-2017 , 09:07   Re: Linux/ Centos 7 compiling module
Reply With Quote #4

Read tutorials online. There's no strictly "what command", it depends on your project. Compiling C++ projects isn't a basic task usually.

Last edited by klippy; 08-31-2017 at 09:07.
klippy is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 08-31-2017 , 12:07   Re: Linux/ Centos 7 compiling module
Reply With Quote #5

I searched many contents online but i there is no damn one useful.......

And i tried to compile this on Linux, Centos 7 with gcc
but i get manny errors
souch of

HTML Code:
Cannot open include file: 'string.h': No such file or directory
Send me an advice please.
__________________

Last edited by ghost95v; 08-31-2017 at 12:11.
ghost95v is offline
Send a message via Skype™ to ghost95v
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-31-2017 , 12:17   Re: Linux/ Centos 7 compiling module
Reply With Quote #6

string.h is a C standard library header and shouldn't ever be missing. I'd be questioning your GCC installation because that doesn't seem right. You should have string.h file in either /usr/include or /usr/local/include.

Last edited by klippy; 08-31-2017 at 12:17.
klippy is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 08-31-2017 , 12:29   Re: Linux/ Centos 7 compiling module
Reply With Quote #7

My gcc version is ...

HTML Code:
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and the string.h file is there
__________________
ghost95v is offline
Send a message via Skype™ to ghost95v
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode