-
Notifications
You must be signed in to change notification settings - Fork 27
Getting Started
This page explains how to link, include and initialize the SDK.
Before starting this guide, download the ModworksSDK, it provides all the files needed to integrate Modworks into your game or modding tool. MinGW and Visual C++ are supported for Windows and GCC for Linux.
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: Modworks is compiled using C++11 so you will need to add the -std=c++11
compiler flag.
ModworksSDK 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 libmodworks.so
provided by the SDK located in the /lib/linux
directory.
Note: Modworks is built using C++11 so you will need to add the -std=c++11
compiler flag.
Add the provided /include/
directory to your include path.
That's it! You should be able to use the ModworksSDK 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 implement.
#Makefile
#run with the 'nmake' command
CC = cl.exe
CFLAGS = /EHsc /MD
SOURCES = Example.cpp
LIBRARIES = ../src/modworks.lib
build:
$(CC) $(CFLAGS) $(SOURCES) /I ../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=../src/modworks.a
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LIBRARIES) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@ -I ../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=../src/libmodworks.so
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