Fix build and create makefile

This commit is contained in:
hodasemi 2022-02-10 08:40:58 +01:00
parent 2d157a0048
commit 0749b34a20
5 changed files with 25 additions and 16 deletions

View file

@ -43,5 +43,10 @@
"xlocinfo": "cpp",
"xlocnum": "cpp",
"xmemory": "cpp"
},
"workbench.colorCustomizations": {
"activityBar.background": "#232E44",
"titleBar.activeBackground": "#30405F",
"titleBar.activeForeground": "#F9FAFC"
}
}

View file

@ -18,17 +18,8 @@
#define _INTERNALS_PLUGIN_HPP_
#include "PluginObjects.hpp" // base class for plugin objects to derive from
// #include <cmath> // for sqrt()
// #include <windows.h> // for HWND
struct HWND
{
int d;
};
double sqrt(double d) {
return d;
}
#include <cmath> // for sqrt()
#include <windows.h> // for HWND
// rF and plugins must agree on structure packing, so set it explicitly here ... whatever the current
// packing is will be restored at the end of this include with another #pragma.

View file

@ -2,8 +2,8 @@
#ifndef _RF_SERVER_H
#define _RF_SERVER_H
#include "InternalsPlugin.hpp"
#include "Socket.hpp"
#include "InternalsPlugin.hpp"
// This is used for the app to use the plugin for its intended purpose
class RFServerPlugin : public InternalsPluginV07 // REMINDER: exported function GetPluginVersion() should return 1 if you are deriving from this InternalsPluginV01, 2 for InternalsPluginV02, etc.
@ -26,11 +26,11 @@ public:
void EndSession(); // session has ended
// GAME OUTPUT
long WantsTelemetryUpdates() { return (1); } // CHANGE TO 1 TO ENABLE TELEMETRY EXAMPLE!
long WantsTelemetryUpdates() { return (1); }
void UpdateTelemetry(const TelemInfoV01 &info);
// SCORING OUTPUT
bool WantsScoringUpdates() { return (false); } // CHANGE TO TRUE TO ENABLE SCORING EXAMPLE!
bool WantsScoringUpdates() { return (true); }
void UpdateScoring(const ScoringInfoV01 &info);
bool WantsPitMenuAccess() { return (true); }

View file

@ -1,8 +1,8 @@
#ifndef _SOCKET_HPP_
#define _SOCKET_HPP_
#include <WinSock2.h>
#include <Ws2tcpip.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdexcept>
#pragma comment(lib, "Ws2_32.lib")

13
Makefile Normal file
View file

@ -0,0 +1,13 @@
CC = x86_64-w64-mingw32-g++
INCLUDES = -I "Include/" -I "/usr/x86_64-w64-mingw32/include"
LIBRARIES = -L/usr/x86_64-w64-mingw32/lib -lws2_32
SOURCES = Source/RFServer.cpp
.PHONY: all clean install
all:
$(CC) -O3 -c $(SOURCES) $(INCLUDES)
$(CC) -O3 -shared -o RFServer.dll RFServer.o $(LIBRARIES)
clean:
-rm RFServer.dll RFServer.o