Compiling plugin for Linux ( building plugin.so )

Started by habi, Jun 24, 2020, 01:43 PM

Previous topic - Next topic

habi

Today, i will show you how to compile your plugin for linux.


You must be having Visual Studio on your computer. Your computer is windows.

You must also have a linux vps.( mine is ubuntu )

What we do is install a thing on vps which will be used for compiling. Then give details of vps to Visual studio ( username: root, password:, and IP address )

Then just click on build on Visual studio. It will copy your project to vps. compile it there and bring back your  output. ( or show a couple of error :D

Detailed Instruction
Step one-> Install Linux Development Workload


2. Create a new Linux Console Application


3. Build. ( it will ask you for details of vps. ip address, username, password. give it )

and

4. You will get error. Go to your vps and install gdb server.
sudo apt install -y build-essential gdbserver
Now it will work. The first application will be a helloworld application by default ( has .out extension). You can copy the file to vps and run it by ./ConsoleApplication.out

Now we are building plugin. It has .so extension. So in visual studio, go to solution properties and change .out to .so

You are done.

Now delete ConsoleApplication.cpp and paste our vcmp plugin files, i.e. SQMain.cpp, SQMain.h, SQFuncns.cpp, SQFuncs.h, plugin.h, ConsoleUtils.cpp, ConsoleUtils.h.
copy the files to project directory

add->existing item


Your are successfully completed. Now click build and your plugin.so will be ready.



Credits
https://devblogs.microsoft.com/cppblog/linux-development-with-c-in-visual-studio/

Files( SQMain.cpp, SQFuncs.cpp, etc. )
https://drive.google.com/file/d/1mrIy_vE5l6Y-OOmJ7e8k7cxMXTKkraAx/view?usp=sharing

tags: Remote build

NicusorN5

#1
Using light themese in IDEs is a warcrime.

Jokes aside, 95 % of VC:MP scripters are too poor to even own a 0.01 USD gamehost. I'm not saying that as a bad thing. I also can't spend money on a game host. It's a waste of time actually.

So, the way to go is a linux-windows dual boot.