Trouble linking Source SDK in a Module

I’m making a server module and I’m trying to include Source SDK to bind addition CNavMesh functionality. Unfortunately, I’m unable to successfully compile the module when I try to include any of the server/nav_* files.

Here is my addition includes:



gmod-module-base-development/include
sourcesdk/mp/src
sourcesdk/mp/src/common
sourcesdk/mp/src/game
sourcesdk/mp/src/game/server
sourcesdk/mp/src/game/server/episodic
sourcesdk/mp/src/game/server/hl2
sourcesdk/mp/src/game/shared
sourcesdk/mp/src/game/shared/episodic
sourcesdk/mp/src/game/shared/hl2
sourcesdk/mp/src/public
sourcesdk/mp/src/public/tier0
sourcesdk/mp/src/public/tier1
sourcesdk/mp/src/utils/common


Here is the code I’m using:



#include <GarrysMod/Lua/Interface.h>

#include <server/nav_mesh.h>

using namespace GarrysMod::Lua;

LUA_FUNCTION(ctor)
{

   return 1;
}
GMOD_MODULE_OPEN()
{

}

GMOD_MODULE_CLOSE()
{
   // NOP
}


Here is the error log:



1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(24): error C2504: 'CBaseEntity' : base class undefined
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(26): warning C4183: 'DECLARE_CLASS': missing return type; assumed to be a member function returning 'int'
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(54): error C2146: syntax error : missing ';' before identifier 'm_iszExcludedClass'
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(31): error C2653: 'BaseClass' : is not a class or namespace name
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(31): error C2065: 'FCAP_IMPULSE_USE' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\modelentities.h(31): error C3861: 'HasSpawnFlags': identifier not found
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(22): error C2146: syntax error : missing ';' before identifier 'sLockedSound'
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(23): error C2146: syntax error : missing ';' before identifier 'sLockedSentence'
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(23): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(24): error C2146: syntax error : missing ';' before identifier 'sUnlockedSound'
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(25): error C2146: syntax error : missing ';' before identifier 'sUnlockedSentence'
1>f:\source-sdk-2013\mp\src\game\server\locksounds.h(25): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(74): error C2504: 'CBaseEntityList' : base class undefined
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(85): error C2143: syntax error : missing ';' before '*'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(85): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(85): error C2061: syntax error : identifier 'CBaseHandle'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(85): warning C4183: 'GetServerNetworkable': missing return type; assumed to be a member function returning 'int'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(86): error C2143: syntax error : missing ';' before '*'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(86): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(86): error C2061: syntax error : identifier 'CBaseHandle'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(86): warning C4183: 'GetBaseNetworkable': missing return type; assumed to be a member function returning 'int'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(87): error C2061: syntax error : identifier 'CBaseHandle'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(88): error C2143: syntax error : missing ';' before '*'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(88): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(88): error C2061: syntax error : identifier 'CBaseHandle'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(88): warning C4183: 'GetEdict': missing return type; assumed to be a member function returning 'int'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(94): error C2061: syntax error : identifier 'IServerNetworkable'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(114): error C2061: syntax error : identifier 'CBaseHandle'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(138): error C2061: syntax error : identifier 'string_t'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(166): error C2061: syntax error : identifier 'IHandleEntity'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(167): error C2061: syntax error : identifier 'IHandleEntity'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C2065: 'iszName' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C2065: 'pSearchingEntity' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C2065: 'pActivator' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C2065: 'pCaller' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C2065: 'pFilter' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(140): error C3861: 'STRING': identifier not found
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C2143: syntax error : missing ';' before '*'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C2433: 'edict_t' : 'inline' not permitted on data declarations
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C2065: 'CBaseHandle' : undeclared identifier
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C2146: syntax error : missing ')' before identifier 'hEnt'
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): error C2761: 'int *CGlobalEntityList::GetEdict(void) const' : member function redeclaration not allowed
1>f:\source-sdk-2013\mp\src\game\server\entitylist.h(177): fatal error C1903: unable to recover from previous error(s); stopping compilation


SourceSDK is the biggest piece of shit ever. I have no idea how Garry made it into a some-what stable sandbox.

[editline]5th September 2017[/editline]

So I fixed the problem. I was missing the GAME_DLL define. Fuck SourceSDK.