[Plugin] [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Yes i am aware of that, but my question here is, how can i get to know when the connection is down and then when it is back up.

I need this so i could lock down the server when the connection is out so that people who should be blocked, not to join.
You'd have to regularly check if a query successfully executes. I'd do it like this:
Код:
public OnGameModeInit()
{
    g_MySQL = mysql_connect(...);
    SetTimer("MySqlConnectionCheck", 5000, true);
    return 1;
}

forward MySqlConnectionCheck();
public MySqlConnectionCheck()
{
    mysql_query(g_MySQL, "SELECT 1", false);
    if(mysql_errno() != 0)
    {
        //error, probably related to network connection
    }
    return 1;
}
Quote:
Originally Posted by MarcGonzales
Посмотреть сообщение
i dont really understand that ORM thing, I learnt SQL pretty well. Can anyone give me a_mysql where queries can be done?
You don't need to use the ORM system. It's completely optional and you can use normal MySQL queries through 'mysql_tquery'.
Reply

I'm getting error related to KERNEL32.dll, which doesn't support Windows server 2003 and Windows XP. I've tried to use all the possible versions to download from the github, could you please upload R37 and older versions? Thanks.
Reply

Quote:
Originally Posted by b3nz
Посмотреть сообщение
I'm getting error related to KERNEL32.dll, which doesn't support Windows server 2003 and Windows XP. I've tried to use all the possible versions to download from the github, could you please upload R37 and older versions? Thanks.
It is already available: https://github.com/pBlueG/SA-MP-MySQL/releases/tag/R37
Reply

It's only the source code. I don't know how to compile it. >:
Reply

I removed the downloads from R35, R36 and R37 because they were too buggy. Use R34.
Reply

Forbidden

You don't have permission to access /mysql/rel/R7/windows/plugin-R7-win32_vs9.rar on this server.
Server unable to read htaccess file, denying access to be safe

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Reply

Hey,
I have two questions:

1)
I have already got a table for saving achievements. It contains: accountid & achievementid
Currently i think that some accounts (in the account table) do not exist but their id's does in the achievement table (since i already had to remove some rows from the account table).
How shall i check for these ids in the achievement table that do not have an alternative in the account's table (same ID)?

And

Keep both connected? As if i did delete an account from the account's table, it should automatically drop the row from the achievements table.

Note: Both tables are linked by the id of the account (AUTO_INCREMENT).

2)
I'm creating a new table that has additional info (ex, mutetime and jailtime), i insert a row once the player gets muted or get jailed, and then drop the row once the mutetime ends and the jailtime is 0.

Lets consider:
The player is not jailed nor muted. He gets muted, a new row is inserted: Jailtime = 0, MuteTime = 10. And then he gets jailed, the statement is itself "Insert" but the row already exists, how shall this be done (update a row if it exists and create a new one if its not)?
Reply

1)

https://dev.mysql.com/doc/refman/5.6...eign-keys.html

Read about CASCADE.

2)

As long as user ID is unique index, you can use: https://dev.mysql.com/doc/refman/5.0...duplicate.html
so if a row exists with that user ID, update the jail and mute time in that row.

Actually Vince has written 2 tutorials that mentioned both of those things you asked for, I suggest you to read them!
Reply

If relations are properly set up then what you experience should be impossible. If you did not use cascade or set null then the MySQL server will not allow you to delete a user if they still have one or more achievements.

To find orphaned records you might try something like:
PHP код:
SELECT FROM (
SELECT achievements.userid as a_uidusers.userid as u_uid FROM achievements LEFT JOIN users ON achievements.userid users.userid) as temp
WHERE u_uid IS NULL 
Untested.
Reply

I've been reading a lot of articles and documentation for optimization and I've discovered INET_ATON and INET_NTOA few days ago. Saving IPs as an integer (UNSIGNED) saves a lot of space but I was wondering which one is better

pawn Код:
SELECT COUNT(ip) FROM some_table WHERE ip BETWEEN INET_ATON('45.166.0.0') AND INET_ATON('45.166.255.255');
pawn Код:
SELECT COUNT(ip) FROM some_table WHERE INET_NTOA(ip) LIKE '45.166.%';
The second is what I came up with as I was using LIKE when I had them stored as VARCHAR as well, the first is from an article.
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I've been reading a lot of articles and documentation for optimization and I've discovered INET_ATON and INET_NTOA few days ago. Saving IPs as an integer (UNSIGNED) saves a lot of space but I was wondering which one is better

pawn Код:
SELECT COUNT(ip) FROM some_table WHERE ip BETWEEN INET_ATON('45.166.0.0') AND INET_ATON('45.166.255.255');
pawn Код:
SELECT COUNT(ip) FROM some_table WHERE INET_NTOA(ip) LIKE '45.166.%';
The second is what I came up with as I was using LIKE when I had them stored as VARCHAR as well, the first is from an article.
I would think that the first one would be faster since inet_aton returns a integer. But something i just found out is you can add "explain" to the beginning of your query and it returns some helpful info.

pawn Код:
explain SELECT COUNT(ip) FROM some_table WHERE ip BETWEEN INET_ATON('45.166.0.0') AND INET_ATON('45.166.255.255');
//and
explain SELECT COUNT(ip) FROM some_table WHERE INET_NTOA(ip) LIKE '45.166.%';
It will show how many rows were checked and it seems that the first one checked less rows so it should(might) be faster possibly. I could be wrong, its something i just found out lastnight.
Reply

ubuntu link not work!
Please give me a new link for mysql.so for ubuntu 14
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I've been reading a lot of articles and documentation for optimization and I've discovered INET_ATON and INET_NTOA few days ago. Saving IPs as an integer (UNSIGNED) saves a lot of space but I was wondering which one is better

pawn Код:
SELECT COUNT(ip) FROM some_table WHERE ip BETWEEN INET_ATON('45.166.0.0') AND INET_ATON('45.166.255.255');
pawn Код:
SELECT COUNT(ip) FROM some_table WHERE INET_NTOA(ip) LIKE '45.166.%';
The second is what I came up with as I was using LIKE when I had them stored as VARCHAR as well, the first is from an article.
Personally, I use the first one. But it must be noted that I select it from a humongous table which contains all CIDR ranges around the world, so the query usually looks something like:
PHP код:
SELECT country FROM iptable WHERE INET_ATON('x.x.x.x'BETWEEN range_start and range_end 
There is no other way to do it because CIDR ranges could go from something like 25.47.0.0 to 25.48.255.255.
Reply

Quote:
Originally Posted by nickdodd25
Посмотреть сообщение
I would think that the first one would be faster since inet_aton returns a integer. But something i just found out is you can add "explain" to the beginning of your query and it returns some helpful info.

pawn Код:
explain SELECT COUNT(ip) FROM some_table WHERE ip BETWEEN INET_ATON('45.166.0.0') AND INET_ATON('45.166.255.255');
//and
explain SELECT COUNT(ip) FROM some_table WHERE INET_NTOA(ip) LIKE '45.166.%';
It will show how many rows were checked and it seems that the first one checked less rows so it should(might) be faster possibly. I could be wrong, its something i just found out lastnight.
Thanks for the "EXPLAIN" statement, I also took a look at "EXPLAIN EXTENDED" for filtered.

Quote:
Originally Posted by Vince
Посмотреть сообщение
Personally, I use the first one. But it must be noted that I select it from a humongous table which contains all CIDR ranges around the world, so the query usually looks something like:
PHP код:
SELECT country FROM iptable WHERE INET_ATON('x.x.x.x'BETWEEN range_start and range_end 
There is no other way to do it because CIDR ranges could go from something like 25.47.0.0 to 25.48.255.255.
Alright, I'm going to use the first one as it was suggested by both of you - thank you for your replies.
Reply

I have same problem on this page: https://sampforum.blast.hk/showthread.php?tid=56564&page=558
Unfortunately there's no solution.

Код:
[root@localhost build]# cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Failed
CMake Error at CMakeLists.txt:74 (message):
  The compiler /usr/bin/c++ does not fulfill all required standards.  Please
  use a different C++ compiler.


-- Configuring incomplete, errors occurred!
See also "/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeError.log".
[root@localhost build]# cmake --version
cmake version 2.8.12.2
[root@localhost build]# /opt/rh/devtoolset-2/root/usr/bin/gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright © 2013 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.
Код:
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_CXX11 failed with the following output:
Change Dir: /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec1377417873/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1377417873.dir/build.make CMakeFiles/cmTryCompileExec1377417873.dir/build
gmake[1]: Entering directory `/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1377417873.dir/src.cxx.o
/usr/bin/c++    -m32 -std=c++11 -DCOMPILER_SUPPORTS_CXX11   -o CMakeFiles/cmTryCompileExec1377417873.dir/src.cxx.o -c /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: error: unrecognized command line option "-std=c++11"
gmake[1]: Leaving directory `/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp'
gmake[1]: *** [CMakeFiles/cmTryCompileExec1377417873.dir/src.cxx.o] Error 1
gmake: *** [cmTryCompileExec1377417873/fast] Error 2

Source file was:

	#include <tuple>
	#include <functional>
	#include <unordered_map>
	#include <forward_list>
	#include <string>

	class CTest
	{
	public:
		CTest() = default;
		~CTest() = default;
		CTest(const CTest &rhs) = delete;
		CTest(CTest &&mv)
		{
			m_Num = mv.m_Num;
			m_NumPtr = mv.m_NumPtr;
		}
		
		int m_Num = 42;
		int *m_NumPtr = nullptr;
		std::unordered_map<std::string, int> m_Map;
		std::forward_list<int> m_ForwardList;
	};

	int main(void)
	{
		int RefVar = 123;
		std::tuple<
			int, 
			std::function<bool(int, int&)>> 
		MyTuple(
			42, [&RefVar](int num1, int &sub_ref)
			{
				RefVar += num1;
				sub_ref += RefVar;
				return true;
			}
		);
		
		enum class StronglyTypedEnum
		{
			ENUM_VAR1,
			ENUM_VAR2
		};
		
		CTest test_class;
		
		return 0;
	}
I'm trying compile on CentOS Linux 6.6, because VPS operation system is too CentOS Linux 6.6. (64bit)

I did this too: http://people.centos.org/tru/devtools-2/readme

I have boost installed by yum install boost.

What's problem and how I can fix it?

Also...

Код:
[root@localhost build]# cmake --DCMAKE_C_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/g++ ..
CMake Error at CMakeLists.txt:74 (message):
  The compiler /opt/rh/devtoolset-2/root/usr/bin/g++ does not fulfill all
  required standards.  Please use a different C++ compiler.


-- Configuring incomplete, errors occurred!
See also "/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /opt/rh/devtoolset-2/root/usr/bin/g++

-- Generating done
-- Build files have been written to: /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build
And there's no 2 log files, but it says that I should look those log files.

// edit.. I updated g++ too, because it was 4.2.X not 4.8.X. Only gcc was 4.8.X. After upgrading now both is 4.8.X.
Still receiving errors:
Код:
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ 
Build flags: 
Id flags: 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ 
Build flags: 
Id flags: -c

The output was:
No such file or directory


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Determining if the CXX compiler works failed with the following output:


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ 
Build flags: 
Id flags: 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ 
Build flags: 
Id flags: -c

The output was:
No such file or directory


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Determining if the CXX compiler works failed with the following output:


Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_CXX11 failed with the following output:
Change Dir: /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec222989886/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec222989886.dir/build.make CMakeFiles/cmTryCompileExec222989886.dir/build
gmake[1]: Entering directory `/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec222989886.dir/src.cxx.o
/opt/rh/devtoolset-2/root/usr/bin/g++    -m32 -std=c++11 -DCOMPILER_SUPPORTS_CXX11   -o CMakeFiles/cmTryCompileExec222989886.dir/src.cxx.o -c /home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec222989886
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec222989886.dir/link.txt --verbose=1
/opt/rh/devtoolset-2/root/usr/bin/g++   -m32 -std=c++11 -DCOMPILER_SUPPORTS_CXX11    CMakeFiles/cmTryCompileExec222989886.dir/src.cxx.o  -o cmTryCompileExec222989886 -rdynamic 
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: cannot find /usr/lib/libstdc++.so.6
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: skipping incompatible /opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++_nonshared.a when searching for -lstdc++_nonshared
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: cannot find -lstdc++_nonshared
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: cannot find /lib/libgcc_s.so.1
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/kasutaja/Desktop/mysql/SA-MP-MySQL-master/build/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec222989886] Error 1
gmake: *** [cmTryCompileExec222989886/fast] Error 2
Reply

@Typhome

Looks like you are compiling the wrong brach. R39-3 is located here: https://github.com/pBlueG/SA-MP-MySQL/tree/issue-54
and does't require cmake.
Reply

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
@Typhome

Looks like you are compiling the wrong brach. R39-3 is located here: https://github.com/pBlueG/SA-MP-MySQL/tree/issue-54
and does't require cmake.
Thank you. I've downloaded CentOS 6.6 32-bit (so I don't have to mess with 32 and 64 bit libraries).
I've downloaded all needed packages (like mysql, groupinstall "Development Tools", boost, etc).

When I go to project directory and do command "make" then I'll get only errors.
make output: http://pastebin.com/QAcCwHAK

// Fixed by downloading sampgdk (it wasn't included when I was downloading the ZIP on mysql project github).
After that I'm still experiencing errors: http://pastebin.com/SExhpsii

// I did "yum install mysql-devel" and again "make", then got compiled. Huraay.

// Also libboost must be properly installed (/usr/lib).
Reply

Quote:
Originally Posted by Typhome
Посмотреть сообщение
Thank you. I've downloaded CentOS 6.6 32-bit (so I don't have to mess with 32 and 64 bit librarys).
I've downloaded all needed packages (like mysql, groupinstall "Development Tools", boost, etc).

When I go to project directory and do command "make" then I'll get only errors.
make output: http://pastebin.com/QAcCwHAK

// Fixed by downloading sampgdk (it wasn't included when I was downloading the ZIP on mysql project github).
After that I'm still experiencing errors: http://pastebin.com/SExhpsii

// I did "yum install mysql-devel" and again "make", then got compiled. Huraay.

// Also libboost must be properly installed (/usr/lib).
Can you post precisely what you did?
I am getting this error;

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find SAMPSDK (missing: SAMPSDK_DIR SAMPSDK_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
cmake/FindSAMPSDK.cmake:21 (find_package_handle_standard_args)
CMakeLists.txt:30 (find_package)
Reply

Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
Can you post precisely what you did?
I am getting this error;

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find SAMPSDK (missing: SAMPSDK_DIR SAMPSDK_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
cmake/FindSAMPSDK.cmake:21 (find_package_handle_standard_args)
CMakeLists.txt:30 (find_package)
Код:
Could NOT find SAMPSDK (missing: SAMPSDK_DIR SAMPSDK_INCLUDE_DIR)
Make sure that you have sampsdk files at <project root>/libs/sdk.

Actually I haven't got correct mysql_static plugin, because size is only circa 540kB. I don't know why compiler won't include libraries.

https://www.upload.ee/files/4799154/...static.so.html
https://www.upload.ee/files/4799153/mysql.so.html

makefile:
Код:
GPP=g++ -m32
GCC=gcc -m32


COMPILE_FLAGS = -c -O3 -w -fPIC -DLINUX -Wall -I libs/ -I libs/sdk/amx/
LIBRARIES = -pthread -lrt -Wl,-Bstatic -lboost_thread -lboost_chrono -lboost_date_time -lboost_system -lboost_atomic -Wl,-Bdynamic


all: compile dynamic_link static_link clean
dynamic: compile dynamic_link clean
static: compile static_link clean

compile:
	@mkdir -p bin
	@echo Compiling plugin..
	@ $(GPP) $(COMPILE_FLAGS) -std=c++0x src/*.cpp
	@echo Compiling plugin SDK..
	@ $(GPP) $(COMPILE_FLAGS) libs/sdk/*.cpp
	@ $(GCC) $(COMPILE_FLAGS) libs/sdk/amx/*.c

dynamic_link:
	@echo Linking \(dynamic\)..
	@ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql.so" *.o -L/usr/lib/mysql/libmysqlclient_r.so $(LIBRARIES)

static_link:
	@echo Linking \(static\)..
	@ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql_static.so" *.o -Wl,-Bstatic -L/usr/lib/mysql/libmysqlclient_r.so -Wl,-Bdynamic $(LIBRARIES)

clean:
	@ rm -f *.o
	@echo Done.
// Now I can run server with dynamic plugin (mysql.so) and before that I had to download some 32-bit library and put them into /lib & /usr/lib. But I still want to compile static plugin, any ideas? After compiling both *.so is exactly same (file size).

Код:
[root@localhost SA-MP-MySQL-R39-3]# cd bin
[root@localhost bin]# ls -al
total 1080
drwxr-xr-x. 2 root root   4096 Jun 25 02:02 .
drwxr-xr-x. 7 root root   4096 Jun 25 02:05 ..
-rwxr-xr-x. 1 root root 547152 Jun 25 02:02 mysql.so
-rwxr-xr-x. 1 root root 547152 Jun 25 02:02 mysql_static.so
Reply

Quote:
Originally Posted by Typhome
Посмотреть сообщение
Код:
Could NOT find SAMPSDK (missing: SAMPSDK_DIR SAMPSDK_INCLUDE_DIR)
Make sure that you have sampsdk files at <project root>/libs/sdk.

Actually I haven't got correct mysql_static plugin, because size is only circa 540kB. I don't know why compiler won't include libmysql.

https://www.upload.ee/files/4799154/...static.so.html
https://www.upload.ee/files/4799153/mysql.so.html

makefile:
Код:
GPP=g++ -m32
GCC=gcc -m32


COMPILE_FLAGS = -c -O3 -w -fPIC -DLINUX -Wall -I libs/ -I libs/sdk/amx/
LIBRARIES = -pthread -lrt -Wl,-Bstatic -lboost_thread -lboost_chrono -lboost_date_time -lboost_system -lboost_atomic -Wl,-Bdynamic


all: compile dynamic_link static_link clean
dynamic: compile dynamic_link clean
static: compile static_link clean

compile:
	@mkdir -p bin
	@echo Compiling plugin..
	@ $(GPP) $(COMPILE_FLAGS) -std=c++0x src/*.cpp
	@echo Compiling plugin SDK..
	@ $(GPP) $(COMPILE_FLAGS) libs/sdk/*.cpp
	@ $(GCC) $(COMPILE_FLAGS) libs/sdk/amx/*.c

dynamic_link:
	@echo Linking \(dynamic\)..
	@ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql.so" *.o -L/usr/lib/mysql/libmysqlclient_r.so $(LIBRARIES)

static_link:
	@echo Linking \(static\)..
	@ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql_static.so" *.o -Wl,-Bstatic -L/usr/lib/mysql/libmysqlclient_r.so -Wl,-Bdynamic $(LIBRARIES)

clean:
	@ rm -f *.o
	@echo Done.
// Now I can run server with dynamic plugin (mysql.so) and before that I had to download some 32-bit library and put them into /lib & /usr/lib. But I still want to compile static plugin, any ideas? After compiling both *.so is exactly same (file size).

Код:
[root@localhost SA-MP-MySQL-R39-3]# cd bin
[root@localhost bin]# ls -al
total 1080
drwxr-xr-x. 2 root root   4096 Jun 25 02:02 .
drwxr-xr-x. 7 root root   4096 Jun 25 02:05 ..
-rwxr-xr-x. 1 root root 547152 Jun 25 02:02 mysql.so
-rwxr-xr-x. 1 root root 547152 Jun 25 02:02 mysql_static.so
I came pretty far, I have tried to install boost but I couldn't do it correctly.
http://pastebin.com/v6P7Pj6B
Where should I place boost?
Reply


Forum Jump:


Users browsing this thread: 30 Guest(s)