-
Notifications
You must be signed in to change notification settings - Fork 27
Getting Started
This page explains how to setup mod.works SDK into your game. Visual C++ and MinGW are supported for Windows, GCC for Linux and Clang for OS X.
Download the latest version of the SDK from the github releases page or from the mod.works website, it provides all the files needed to integrate mod.works into your game or modding tool.
Link the provided import library modworks.lib
and place all the provided DLL files next to your executable.
The import library is located at lib/visualc++/
and the DLLs at bin/visualc++/
.
Link the provided import library modworks.a
and place all the provided DLL files next to your executable.
The import library is located at lib/mingw/
and the DLLs at bin/mingw/
.
Note: Mod.works is compiled using C++11 so you will need to add the -std=c++11
compiler flag.
mod.works SDK uses LibCurl, Zlib, Minizip and Pthread. Usually, they are already present on your Linux distribution. If it's not the case, install them using your package manager:
apt-get install libcurl4-openssl-dev zlib1g-dev libpthread-stubs0-dev
Link the the provided shared library modworks.so
located in the lib/linux/
directory.
Note: Mod.works 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.works SDK dependencies so no additional setup is required.
Link the the provided shared library modworks.dylib
located in the lib/osx/
directory.
Note: Mod.works 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! You should be able to use the mod.works SDK on your project.
#include <ModworksSDK.h>
int main()
{
modworks::init(/*your game id*/7, "YOUR-API-KEY");
return 0;
}
The following are complete Makefile examples that shows how to link and import mod.works SDK into your project.
#Makefile
#run with the 'nmake' command
CC = cl.exe
CFLAGS = /EHsc /MD
SOURCES = Example.cpp
LIBRARIES = modworks.lib
build:
$(CC) $(CFLAGS) $(SOURCES) /I ModworksSDK/include /link $(LIBRARIES) /SUBSYSTEM:CONSOLE
#Makefile
#run with the 'MinGW32-make.exe' command
CC=g++
CFLAGS=-c -Wall -std=c++11
SOURCES=Example.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=Example
LIBRARIES=modworks.a
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LIBRARIES) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@ -I ModworksSDK/include
#Makefile
#run with the 'make' command
CC=g++
CFLAGS=-c -Wall -std=c++11
LDFLAGS=-lcurl -pthread -lz
SOURCES=Example.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=Example
LIBRARIES=modworks.so
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LIBRARIES) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@ -I ModworksSDK/include
#Makefile
#run with the 'make' command
CC=clang++
CFLAGS=-c -Wall -std=c++11
LDFLAGS=-lcurl -lz
SOURCES=Example.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=Example
LIBRARIES=modworks.dylib
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LIBRARIES) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@ -I ../include
- 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