-
Notifications
You must be signed in to change notification settings - Fork 27
Getting Started
This page explains how to setup mod.io SDK into your game. Visual C++ and MinGW are supported for Windows, GCC for Linux and Clang for MacOS. Also, you can take a look at our Sample Projects showing the minimum setup required to start using mod.io on specific compilers.
Download the latest version of the SDK from the github releases page or from the mod.io website, it provides all the files needed to integrate mod.io into your game or modding tool.
Link the provided import library libmodio.lib
and place all the libmodio.dll next to your executable.
The import library is located at lib/visualc++/
and the DLL at bin/visualc++/
.
Note: You will need to install the Visual C++ Redistributable for Visual Studio in order to use the mod.io Visual C++ libraries.
Link the provided import library libmodio.a
and place all the libmodio.dll files next to your executable.
The import library is located at lib/mingw/
and the DLLs at bin/mingw/
.
Note: mod.io is compiled using C++11 so you will need to add the -std=c++11
compiler flag.
mod.io SDK uses LibCurl and Zlib. Usually, they are already present on your Linux distribution. If it's not the case, install them using your package manager:
apt-get install g++ libcurl4-openssl-dev zlib1g-dev
Link the the provided shared library libmodio.so
located in the lib/linux/
directory.
Note: mod.io SDK is built using C++11 so you will need to add the -std=c++11
compiler flag.
Install Clang shipped with the XCode build essentials. This will install all mod.io SDK dependencies so no additional setup is required.
Link the the provided shared library libmodio.dylib
located in the lib/osx/
directory.
Note: mod.io SDK is built using C++11 so you will need to add the -std=c++11
compiler flag.
Add the provided include/
directory to your compiler's include path.
That's it! Once you have initialized the SDK instance, you should be able to use all the mod.io functionality on your project.
#include "modio.h"
int main()
{
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b");
return 0;
}
Now that mod.io has been integrated into your project, please refer to the mod.io documentation and Code Samples in order to customize your integration.
The following are complete Makefile examples that shows how to link and import mod.io SDK into your project.
#Makefile
#run with the 'nmake' command
CC = cl.exe
CFLAGS = /EHsc /MD
build:
$(CC) $(CFLAGS) main.cpp modio.lib /I include
#Makefile
#run with the 'MinGW32-make.exe' command
CC=g++
CFLAGS=-Wall -std=c++11
all: main.cpp
$(CC) $(CFLAGS) main.cpp -o example -I ./include libmodio.dll.a
#Makefile
#run with the 'make' command
CC=g++
CFLAGS=-Wall -std=c++11
all: main.cpp
$(CC) $(CFLAGS) main.cpp -o example -I ./include libmodio.so -lcurl -Wl,-rpath .
#Makefile
#run with the 'make' command
CC=clang++
CFLAGS=-Wall -std=c++11
all: main.cpp
$(CC) $(CFLAGS) main.cpp -o example -I ./include libmodio.dylib -Wl,-rpath .
Static binaries are also provided under the static/
lib directory. The following adjustments should be made when compiling statically.
- Define the
MODIO_STATICLIB
andCURL_STATICLIB
preprocessor flag. Under Properties > C/C++ > Preprocessor Definitions - Link the following dependencies from the base visual studio libraries
ws2_32.lib;wldap32.lib;advapi32.lib;kernel32.lib;comdlg32.lib;crypt32.lib;normaliz.lib
. (Under Properties > Linker > Input > Additional Dependencies) - Link the following dependencies provided by the SDK
lib/MSVC/x86/libcurl_a.lib
andlib/MSVC/x86/zlib.lib
. (Again under Properties > Linker > Input > Additional Dependencies)
- Link curl and zlib by adding the following link flags:
-lcurl
and-lz
.
- Home
- Table of Contents
- Getting Started
- SDK Methods
- Creators
- Editors
- Schemas
- modio::Avatar
- modio::Comment
- modio::Dependency
- modio::Download
- modio::Error
- modio::Filehash
- modio::Game
- modio::GameTagOption
- modio::Header
- modio::Icon
- modio::Image
- modio::InstalledMod
- modio::Logo
- modio::Media
- modio::MetadataKVP
- modio::Mod
- modio::ModEvent
- modio::Modfile
- modio::QueuedModDownload
- modio::QueuedModfileUpload
- modio::Rating
- modio::Response
- modio::Stats
- modio::Tag
- modio::User
- Debugging
- Constants
-
C Compatibility
- Methods
- Initialization, Process and Shutdown (C compatible)
- User Authentication (C compatible)
- Mods (C compatible)
- Modfiles (C compatible)
- Media (C compatible)
- Subscriptions (C compatible)
- Events (C compatible)
- Stats (C compatible)
- Tags (C compatible)
- Ratings (C compatible)
- Metadata KVP (C compatible)
- Dependencies (C compatible)
- Comments (C compatible)
- Reports (C compatible)
- Me (C compatible)
- Downloads (C compatible)
- Uploads (C compatible)
- Logs (C compatible)
- External Auth (C compatible)
- Configuration (C compatible)
- Creators
- Editors
- Schemas
- ModioAvatar
- ModioComment
- ModioDependency
- ModioDownload
- ModioError
- ModioFilehash
- ModioGame
- ModioGameTagOption
- ModioHeader
- ModioIcon
- ModioImage
- ModioInstalledMod
- ModioListNode
- ModioLogo
- ModioMedia
- ModioMetadataKVP
- ModioMod
- ModioModEvent
- ModioModfile
- ModioQueuedModDownload
- ModioQueuedModfileUpload
- ModioRating
- ModioResponse
- ModioStats
- ModioTag
- ModioUser
- Methods
- Building