Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
125 views
in Technique[技术] by (71.8m points)

c++ - Cannot build hl2 source solution

I successfully made a mod of half life 2, but when I try to build the solution it fails with roughly 90 errors. These problems can't be related to the mod, as I have not added anything yet, I created a hl2 mod using source 2006 and immediately tried to build when I received this: (P.S. I'm using windows 10 and visual studio 2013)

1>------ Rebuild All started: Project: client_hl2, Configuration: Debug HL2 Win32 ------
2>------ Rebuild All started: Project: server_hl2, Configuration: Debug HL2 Win32 ------

2>c:mod2srcdllsai_movesolver.cpp(19): error C2084: function 'float round(float) throw()' already has a body
2>          c:program files (x86)microsoft visual studio 12.0vcincludemath.h(1125) : see previous definition of 'round'
2>c:mod2srcdllsai_movesolver.cpp(136): error C2264: 'round' : error in function definition or declaration; function not called

1>c:mod2srccl_dllhl2_hudhud_autoaim.cpp(202): warning C4189: 'dist' : local variable is initialized but not referenced
1>  hud_battery.cpp
1>  hud_blood.cpp
1>  hud_credits.cpp
1>c:mod2srccl_dllhl2_hudhud_credits.cpp(7): warning C4627: '#include "hudelement.h"': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header
1>c:mod2srccl_dllhl2_hudhud_credits.cpp(8): warning C4627: '#include "hud_numericdisplay.h"': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header
1>c:mod2srccl_dllhl2_hudhud_credits.cpp(9): warning C4627: '#include <vgui_controls/Panel.h>': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header
1>  hud_damageindicator.cpp
1>  hud_flashlight.cpp
1>c:mod2srccl_dllhl2_hudhud_flashlight.cpp(7): warning C4627: '#include "hudelement.h"': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header
1>c:mod2srccl_dllhl2_hudhud_flashlight.cpp(8): warning C4627: '#include "hud_numericdisplay.h"': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header
1>c:mod2srccl_dllhl2_hudhud_flashlight.cpp(9): warning C4627: '#include <vgui_controls/Panel.h>': skipped when looking for precompiled header use
1>          Add directive to 'cbase.h' or rebuild precompiled header

1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120Microsoft.CppBuild.targets(1193,5): warning MSB8012: TargetPath(C:Mod2srccl_dllDebug HL2client_hl2.dll) does not match the Linker's OutputFile property value (C:Mod2srccl_dllDebug HL2client.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120Microsoft.CppBuild.targets(1195,5): warning MSB8012: TargetName(client_hl2) does not match the Linker's OutputFile property value (client). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

1>randoverride.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
1>bitmap.lib(S3_intrf.obj) : error LNK2026: module unsafe for SAFESEH image.
1>bitmap.lib(S3_quant.obj) : error LNK2026: module unsafe for SAFESEH image.
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtCheckMemory already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtDoForAllClientObjects already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtDumpMemoryLeaks already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtIsMemoryBlock already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtIsValidHeapPointer already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtIsValidPointer already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtMemCheckpoint already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtMemDifference already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtMemDumpAllObjectsSince already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtMemDumpStatistics already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtReportBlockType already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetAllocHook already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetBreakAlloc already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetDbgBlockType already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetDbgFlag already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetDumpClient already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __calloc_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __expand already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __expand_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __heap_alloc already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __malloc_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __msize already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __msize_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __nh_malloc already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __nh_malloc_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __realloc_dbg already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __crtBreakAlloc already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __crtDbgFlag already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __CrtSetReportFile already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __CrtSetReportHook already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __CrtSetReportMode already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __crtAssertBusy already defined in memoverride-vc7.obj
1>LIBCMTD.lib(heapinit.obj) : error LNK2005: __heap_init already defined in memoverride-vc7.obj
1>LIBCMTD.lib(heapinit.obj) : error LNK2005: __heap_term already defined in memoverride-vc7.obj
1>LIBCMTD.lib(malloc.obj) : error LNK2005: __malloc_base already defined in memoverride-vc7.obj
1>LIBCMTD.lib(dbgrpt.obj) : error LNK2005: __CrtDbgReport already defined in memoverride-vc7.obj
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
1>     Creating library Debug HL2client.lib and object Debug HL2client.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Debug HL2client.dll : fatal error LNK1281: Unable to generate SAFESEH image.

2>c:mod2srcdllsmapentities.cpp(8): warning C4627: '#include "winlite.h"': skipped when looking for precompiled header use
2>          Add directive to 'cbase.h' or rebuild precompiled header

2>c:mod2srcdllssound.cpp(15): warning C4627: '#include "xbox/xbox_platform.h"': skipped when looking for precompiled header use
2>          Add directive to 'cbase.h' or rebuild precompiled header
2>c:mod2srcdllssound.cpp(16): warning C4627: '#include "xbox/xbox_win32stubs.h"': skipped when looking for precompiled header use
2>          Add directive to 'cbase.h' or rebuild precompiled header
2>c:mod2srcdllssound.cpp(17): warning C4627: '#include "xbox/xbox_core.h"': skipped when looking for precompiled header use
2>          Add directive to 'cbase.h' or rebuild precompiled header
========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========
question from:https://stackoverflow.com/questions/65942445/cannot-build-hl2-source-solution

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...