Vice City: Multiplayer

Server Development => Community Plugins => Topic started by: habi on Jun 24, 2020, 01:43 PM

Title: Compiling plugin for Linux ( building plugin.so )
Post by: habi on Jun 24, 2020, 01:43 PM
Today, i will show you how to compile your plugin for linux.
(https://i.imgur.com/WTtiMyI.png)

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
(https://devblogs.microsoft.com/wp-content/uploads/sites/9/2019/02/LinuxWorkload.png)

2. Create a new Linux Console Application
(https://i.imgur.com/C8pGhI0.png)

3. Build. ( it will ask you for details of vps. ip address, username, password. give it )
(https://i.imgur.com/I1TdXVI.png)
and
(https://i.imgur.com/KZ5fBPe.png)
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
(https://i.imgur.com/RE0Kn1S.png)
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
(https://i.imgur.com/Qax3PE2.jpg)
add->existing item
(https://i.imgur.com/ozxsfYH.jpg)

Your are successfully completed. Now click build and your plugin.so will be ready.
(https://i.imgur.com/JUxVzrk.png)


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
Title: Re: Compiling plugin for Linux ( build .so )
Post by: NicusorN5 on Jun 24, 2020, 08:46 PM
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.