nillerusr / source-engine

Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses
Other
1.21k stars 190 forks source link

can't build dedicated server (dedicated.dll) for windows #310

Closed desumachii closed 9 months ago

desumachii commented 11 months ago

any way to fix this unresolved external symbols?


Creating library dedicated\dedicated.lib and object dedicated\dedicated.exp
SteamAppStartup.cpp.5.o : error LNK2019: unresolved external symbol __imp__PostMessageA@16 referenced in function "void __cdecl LaunchSelfViaSteam(char const *)" (?LaunchSelfViaSteam@@YAXPBD@Z)
SteamAppStartup.cpp.5.o : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl LaunchSelfViaSteam(char const *)" (?LaunchSelfViaSteam@@YAXPBD@Z)
sys_common.cpp.5.o : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
sys_windows.cpp.5.o : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
SteamAppStartup.cpp.5.o : error LNK2019: unresolved external symbol __imp__FindWindowA@8 referenced in function "void __cdecl LaunchSelfViaSteam(char const *)" (?LaunchSelfViaSteam@@YAXPBD@Z)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "bool __cdecl vgui::VGui_InitInterfacesList(char const *,void * (__cdecl**)(char const *,int *),int)" (?VGui_InitInterfacesList@vgui@@YA_NPBDPAP6APAX0PAH@ZH@Z) referenced in function "public: virtual bool __thiscall CDedicatedAppSystemGroup::PreInit(void)" (?PreInit@CDedicatedAppSystemGroup@@UAE_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "int __cdecl StartVGUI(void * (__cdecl*)(char const *,int *))" (?StartVGUI@@YAHP6APAXPBDPAH@Z@Z) referenced in function "public: virtual bool __thiscall CDedicatedAppSystemGroup::PreInit(void)" (?PreInit@CDedicatedAppSystemGroup@@UAE_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "void __cdecl StopVGUI(void)" (?StopVGUI@@YAXXZ) referenced in function "public: virtual void __thiscall CDedicatedAppSystemGroup::PostShutdown(void)" (?PostShutdown@CDedicatedAppSystemGroup@@UAEXXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "void __cdecl RunVGUIFrame(void)" (?RunVGUIFrame@@YAXXZ) referenced in function "bool __cdecl ConsoleStartup(void)" (?ConsoleStartup@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "bool __cdecl VGUIIsRunning(void)" (?VGUIIsRunning@@YA_NXZ) referenced in function "bool __cdecl ConsoleStartup(void)" (?ConsoleStartup@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "bool __cdecl VGUIIsStopping(void)" (?VGUIIsStopping@@YA_NXZ) referenced in function "bool __cdecl ConsoleStartup(void)" (?ConsoleStartup@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "bool __cdecl VGUIIsInConfig(void)" (?VGUIIsInConfig@@YA_NXZ) referenced in function "bool __cdecl ConsoleStartup(void)" (?ConsoleStartup@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "void __cdecl VGUIFinishedConfig(void)" (?VGUIFinishedConfig@@YAXXZ) referenced in function "bool __cdecl DoRunVGUIFrame(bool)" (?DoRunVGUIFrame@@YA_N_N@Z)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function "bool __cdecl HandleVCRHook(void)" (?HandleVCRHook@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function "bool __cdecl HandleVCRHook(void)" (?HandleVCRHook@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "public: __thiscall CTextConsoleWin32::CTextConsoleWin32(void)" (??0CTextConsoleWin32@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'console''(void)" (??__Econsole@@YAXXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual bool __thiscall CTextConsoleWin32::Init(void)" (?Init@CTextConsoleWin32@@UAE_NXZ) referenced in function "bool __cdecl ConsoleStartup(void)" (?ConsoleStartup@@YA_NXZ)
sys_ded.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual void __thiscall CTextConsoleWin32::ShutDown(void)" (?ShutDown@CTextConsoleWin32@@UAEXXZ) referenced in function "public: virtual void __thiscall CDedicatedAppSystemGroup::PostShutdown(void)" (?PostShutdown@CDedicatedAppSystemGroup@@UAEXXZ)
sys_ded.cpp.5.o : error LNK2001: unresolved external symbol "char * gpszCvars" (?gpszCvars@@3PADA)
basefilesystem.cpp.5.o : error LNK2019: unresolved external symbol __imp__SHGetFileInfoW@20 referenced in function "public: virtual bool __thiscall CBaseFileSystem::GetFileTypeForFullPath(char const *,wchar_t *,unsigned int)" (?GetFileTypeForFullPath@CBaseFileSystem@@UAE_NPBDPA_WI@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "public: virtual void __thiscall CSys::ErrorMessage(int,char const *)" (?ErrorMessage@CSys@@UAEXHPBD@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol __imp__CommandLineToArgvW@8 referenced in function _DedicatedMain
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "void __cdecl VGUIPrintf(char const *)" (?VGUIPrintf@@YAXPBD@Z) referenced in function "public: virtual void __thiscall CSys::ConsoleOutput(char *)" (?ConsoleOutput@CSys@@UAEXPAD@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual void __thiscall CTextConsoleWin32::Print(char *)" (?Print@CTextConsoleWin32@@UAEXPAD@Z) referenced in function "public: virtual void __thiscall CSys::ConsoleOutput(char *)" (?ConsoleOutput@CSys@@UAEXPAD@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual void __thiscall CTextConsoleWin32::SetTitle(char *)" (?SetTitle@CTextConsoleWin32@@UAEXPAD@Z) referenced in function "public: virtual void __thiscall CSys::UpdateStatus(int)" (?UpdateStatus@CSys@@UAEXH@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual void __thiscall CTextConsoleWin32::SetStatusLine(char *)" (?SetStatusLine@CTextConsoleWin32@@UAEXPAD@Z) referenced in function "public: virtual void __thiscall CSys::UpdateStatus(int)" (?UpdateStatus@CSys@@UAEXH@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual void __thiscall CTextConsoleWin32::UpdateStatus(void)" (?UpdateStatus@CTextConsoleWin32@@UAEXXZ) referenced in function "public: virtual void __thiscall CSys::UpdateStatus(int)" (?UpdateStatus@CSys@@UAEXH@Z)
sys_windows.cpp.5.o : error LNK2019: unresolved external symbol "public: virtual char * __thiscall CTextConsoleWin32::GetLine(int,char *,int)" (?GetLine@CTextConsoleWin32@@UAEPADHPADH@Z) referenced in function "public: virtual char * __thiscall CSys::ConsoleInput(int,char *,int)" (?ConsoleInput@CSys@@UAEPADHPADH@Z)
D:\Source Engine Advanced\source-engine\build\dedicated\dedicated.dll : fatal error LNK1120: 26 unresolved externals

23:40:21 runner ['C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x86\\MT.exe', '/nologo', '-manifest', 'D:\\Source Engine Advanced\\source-engine\\build\\dedicated_main\\dedicated_launcher.exe.manifest', '-outputresource:D:\\Source Engine Advanced\\source-engine\\build\\dedicated_main\\dedicated_launcher.exe;1']
   Creating library datacache\datacache.lib and object datacache\datacache.exp

23:40:21 runner ['C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x86\\MT.exe', '/nologo', '-manifest', 'D:\\Source Engine Advanced\\source-engine\\build\\datacache\\datacache.dll.manifest', '-outputresource:D:\\Source Engine Advanced\\source-engine\\build\\datacache\\datacache.dll;2']
disp_powerinfo.cpp

Waf: Leaving directory `D:\Source Engine Advanced\source-engine\build'
Build failed
 -> task in 'dedicated' failed with exit status 1120:
        {task 98823408: cxxshlib filesystem.cpp.5.o,filesystem_init.cpp.5.o,netapi.cpp.5.o,SteamAppStartup.cpp.5.o,sys_common.cpp.5.o,sys_ded.cpp.5.o,conproc.cpp.5.o,textconsole.cpp.5.o,filetracker.cpp.5.o,basefilesystem.cpp.5.o,packfile.cpp.5.o,filesystem_async.cpp.5.o,filesystem_stdio.cpp.5.o,QueuedLoader.cpp.5.o,zip_utils.cpp.5.o,memoverride.cpp.5.o,sys_windows.cpp.5.o -> dedicated.dll,dedicated.pdb,dedicated.lib,dedicated.dll.manifest}
['C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x86\\LINK.exe', '/nologo', '/MANIFEST', '/nologo', '/MANIFEST', '/DEBUG', '/INCREMENTAL', '/NODEFAULTLIB:libc', '/NODEFAULTLIB:libcd', '/NODEFAULTLIB:libcmtd', '/LARGEADDRESSAWARE', '/LIBPATH:D:\\Source Engine Advanced\\source-engine/lib/win32/x86/', '/LIBPATH:D:\\Source Engine Advanced\\source-engine/dx9sdk/lib/x86/', '/subsystem:WINDOWS,5.01', '/IMPLIB:dedicated\\dedicated.lib', '/DLL', 'dedicated\\filesystem.cpp.5.o', 'public\\filesystem_init.cpp.5.o', 'common\\netapi.cpp.5.o', 'common\\SteamAppStartup.cpp.5.o', 'dedicated\\sys_common.cpp.5.o', 'dedicated\\sys_ded.cpp.5.o', 'dedicated\\console\\conproc.cpp.5.o', 'dedicated\\console\\textconsole.cpp.5.o', 'filesystem\\filetracker.cpp.5.o', 'filesystem\\basefilesystem.cpp.5.o', 'filesystem\\packfile.cpp.5.o', 'filesystem\\filesystem_async.cpp.5.o', 'filesystem\\filesystem_stdio.cpp.5.o', 'filesystem\\QueuedLoader.cpp.5.o', 'public\\zip_utils.cpp.5.o', 'public\\tier0\\memoverride.cpp.5.o', 'dedicated\\sys_windows.cpp.5.o', '/OUT:D:\\Source Engine Advanced\\source-engine\\build\\dedicated\\dedicated.dll', '/LIBPATH:vpklib', '/LIBPATH:tier1', '/LIBPATH:tier2', '/LIBPATH:tier3', '/LIBPATH:appframework', '/LIBPATH:mathlib', 'vpklib.lib', 'tier1.lib', 'tier2.lib', 'tier3.lib', 'appframework.lib', 'mathlib.lib', '/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.34.31933\\lib\\x86', '/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x86', '/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x86', '/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x86', '/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.34.31933\\lib\\x86', '/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.34.31933\\lib\\x86\\store\\references', '/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.22621.0', '/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.22621.0', '/LIBPATH:C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319', '/LIBPATH:vstdlib', '/LIBPATH:tier0', '/LIBPATH:stub_steam', 'vstdlib.lib', 'tier0.lib', 'steam_api.lib', 'advapi32.lib', 'ws2_32.lib', 'rpcrt4.lib']
WesleiRamos commented 11 months ago

Same problem here

dimhotepus commented 10 months ago

Replace in https://github.com/nillerusr/source-engine/blob/master/dedicated/wscript:

       if bld.env.DEST_OS == 'win32':
        source += [
            'sys_windows.cpp'
        ]

with

       if bld.env.DEST_OS == 'win32':
        source += [
            'sys_windows.cpp',
                        'console/TextConsoleWin32.cpp'
        ]

and

    libs = ['tier0','vpklib','tier1','tier2','tier3','vstdlib','steam_api','appframework','mathlib', 'EDIT']

with

    libs = ['tier0','vpklib','tier1','tier2','tier3','vstdlib','steam_api','appframework','mathlib', 'EDIT']

        if bld.env.DEST_OS == 'win32':
         libs += ['vgui_controls', 'USER32', 'SHELL32']