Log in

View Full Version : Tutorial: Compile vaultscript with CodeBlocks on Windows



zamp
12-15-2012, 05:55 AM
Download and install required software
Download and install Code::Blocks from https://www.codeblocks.org/downloads
Download and install latest MinGW from https://sourceforge.net/projects/mingw/files/latest/download?source=files

Setup Code::Blocks to work with new MinGW
Launch Code::Blocks

Go to Settings -> Compiler and debugger...
Under Toolchain executables change Compiler's installation directory to where you installed MinGW (Default C:\MinGW\)

Create a project for vaultscript
Create a new project (File -> New -> Project...)
Choose Dynamic Link Library as the project type.
Choose a suitable location for the project.
Copy vaultscript.cpp and vaultscript.h files to where your project is.
Remove main.cpp and main.h from the project and delete the files. (Optional but I recommend this)

Set compiler and linker options
Right click your project name in the Management view and choose Build options...
Select the project name from the menu on the left. That way you don't have to add the options for both Debug and Release separately.
Under Compiler settings -> Other options add the following line:
-std=gnu++11

Under Linker settings / Other linker options add the following lines:
-static-libgcc
-static-libstdc++

Remove user32 from Linker settings / Link libraries (You'll find this in Debug/Release)

Set project build path
Right click your project name in the Management view and choose Properties...
Under Build targets set Output filename: to where your vaultmp server's executable is located.
Set this for both Debug and Release.

Finishing touches
Change build target to Release (It's on the toolbar)
Compile (gear icon)
Add vaultscript.dll into the vaultserver.ini's scripts
Launch server and all should work just fine.

Happy scripting!​

Aeronix
06-04-2013, 12:58 AM
Heads up, MinGW only offers support on versions higher than 1.7.0 for C++11.