Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build Azure Sheep and Opfor server dll for GoldSrc (Cmake, MSVC) #141

Closed
Alex3474247 opened this issue Nov 21, 2020 · 12 comments
Closed

Comments

@Alex3474247
Copy link

Alex3474247 commented Nov 21, 2020

When I tried to compile it using the compile.bat script, I added files from asheep folder there, I got some errors in the client.cpp file, that are below:

client.cpp(1671) : error C2039: 'm_flStartThrow' : is not a member of 'CBasePlay
erWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1672) : error C2039: 'm_flReleaseThrow' : is not a member of 'CBasePl
ayerWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1673) : error C2039: 'm_chargeReady' : is not a member of 'CBasePlaye
rWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1674) : error C2039: 'm_fInAttack' : is not a member of 'CBasePlayerW
eapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1675) : error C2039: 'm_fireState' : is not a member of 'CBasePlayerW
eapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1766) : error C2039: 'ammo_9mm' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1767) : error C2039: 'ammo_357' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1768) : error C2039: 'ammo_argrens' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1769) : error C2039: 'ammo_bolts' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1770) : error C2039: 'ammo_buckshot' : is not a member of 'CBasePlaye
r'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1771) : error C2039: 'ammo_rockets' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1772) : error C2039: 'ammo_uranium' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1773) : error C2039: 'ammo_hornets' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'

What's wrong here?
The rest files compiled without errors.
also I could not find correct makefile to compile client dll in asheep branch.
I want to test it in game to look if what unfinished things are still left.
Upd: Compiled ok with cmake and msvc 2019.

@nekonomicon
Copy link
Member

nekonomicon commented Nov 22, 2020

I recommend to use cmake if you have modern MSVC version.
compile.bat was not updated for mods.
Also, please read discussion about build systems:
#105

@Alex3474247
Copy link
Author

I used MSVC 2019 and cmake, server dll compiled ok, but I still wanna compile client dll, i found no appropriate cmakelists or wscript (does not contain new asheep files), I cannot continue without it.

@nekonomicon
Copy link
Member

nekonomicon commented Nov 22, 2020

Azure Sheep was made on an old hlsdk version without full client weapon prediction. So client does not have duplicated weapons code.

@Alex3474247
Copy link
Author

Alex3474247 commented Nov 22, 2020

Got you. If I use cl_dll cmakelists which is from the branch, regenerate the solution, the compile errors are the following:

Build started...
1>------ Build started: Project: client, Configuration: Debug Win32 ------
1> Creating library C:/Users/User/Downloads/hlsdk-xash3d-asheep/build/cl_dll/Debug/client.lib and object C:/Users/User/Downloads/hlsdk-xash3d-asheep/build/cl_dll/Debug/client.exp
1>input_goldsource.obj : error LNK2019: unresolved external symbol __imp__joyGetPosEx@8 referenced in function "void __cdecl IN_StartupJoystick(void)" (?IN_StartupJoystick@@yaxxz)
1>input_goldsource.obj : error LNK2019: unresolved external symbol __imp__joyGetNumDevs@0 referenced in function "void __cdecl IN_StartupJoystick(void)" (?IN_StartupJoystick@@yaxxz)
1>input_goldsource.obj : error LNK2019: unresolved external symbol __imp__joyGetDevCapsA@12 referenced in function "void __cdecl IN_StartupJoystick(void)" (?IN_StartupJoystick@@yaxxz)
1>C:\Users\User\Downloads\hlsdk-xash3d-asheep\build\cl_dll\Debug\client.dll : fatal error LNK1120: 3 unresolved externals
1>Done building project "client.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Maybe I should forget about GoldSrc and try to compile the launcher for Android first?

@nekonomicon
Copy link
Member

Oh, I forgot... There was fix in master branch.
You need to link winmm.lib.

@Alex3474247
Copy link
Author

Alex3474247 commented Nov 22, 2020

Thanks, it seems to compile.
But game does not work, in xash too (throws to console).:
Couldn't get GiveFnptrsToDll in C:\Games\half-life\asheep\dlls\hl.dll
Host_Error: Couldn't get DLL API from C:\Games\half-life\asheep\dlls\hl.dll!
To be more exact:
image

@nekonomicon
Copy link
Member

You need to link hl.def to server library.
https://github.com/FWGS/hlsdk-xash3d/blob/master/dlls/wscript#L13

@Alex3474247
Copy link
Author

Thank you, that helped. Game works. Though I was alarmed by the message::

GAME SKILL LEVEL:1
0 entities inhibited
PF_MessageEnd_I: Unknown User Msg 97
Game started
Server requiring authentication
Local connection.
Connection accepted.
Spooling demo header.

@nekonomicon
Copy link
Member

Our client does not have vgui interface and handlers for some messages.

@Alex3474247
Copy link
Author

Also I have problem compiling Opfor:
1>C:\hlsdk-xash3d-opfor\dlls\gearbox\voltigore.cpp(167,2): error C3861: 'ResetTouch': identifier not found

@Alex3474247 Alex3474247 changed the title Failed to build Azure Sheep server dll for GoldSrc (compile.bat) Failed to build Azure Sheep and Opfor server dll for GoldSrc (compile.bat) Nov 26, 2020
@Alex3474247 Alex3474247 changed the title Failed to build Azure Sheep and Opfor server dll for GoldSrc (compile.bat) Failed to build Azure Sheep and Opfor server dll for GoldSrc (Cmake) Nov 26, 2020
@Alex3474247 Alex3474247 changed the title Failed to build Azure Sheep and Opfor server dll for GoldSrc (Cmake) Failed to build Azure Sheep and Opfor server dll for GoldSrc (Cmake, MSVC) Nov 26, 2020
@FreeSlave
Copy link
Member

ResetTouch is left undefined for a debug mode in msvc. Just replace it with SetTouch(NULL)

@nekonomicon
Copy link
Member

@Alex3474247 It would be better to create one issue per bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants