kevoreilly / capemon

capemon: CAPE's monitor
GNU General Public License v3.0
97 stars 46 forks source link

[Compile] LINK : fatal error C1047: The object or library file 'libyara\lib\libyara64.lib' was created by a different version of the compiler #68

Closed Od0VxibTqto6Hs closed 10 months ago

Od0VxibTqto6Hs commented 1 year ago

Failed to build after 8bf93ca update the libyara\lib\libyara64.lib and libyara\lib\libyara86.lib file.

Error Info

Build FAILED.
       "T:\t\capemon\capemon.sln" (Rebuild target) (1) ->
       "T:\t\capemon\capemon.vcxproj.metaproj" (Rebuild target) (2) ->
       "T:\t\capemon\capemon.vcxproj" (Rebuild target) (5) ->
       (Link target) ->
         LINK : fatal error C1047: The object or library file 'T:\t\capemon\\libyara\lib\libyara64.lib' was created by a different version of the compiler than other objects like 'x64\Release\alloc.obj'; rebu
       ild all objects and libraries with the same compiler [T:\t\capemon\capemon.vcxproj]
         LINK : fatal error LNK1257: code generation failed [T:\t\capemon\capemon.vcxproj]

    2 Error(s)

Reproduce Command

link.exe /ERRORREPORT:NONE /OUT:"x64\Release\capemon_x64.dll" /INCREMENTAL /ILK:"x64\Release\capemon_x64.ilk" /NOLOGO /LIBPATH:x64\Release /LIBPATH:libyara\lib libyara64.lib bson.lib crypt32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEF:"capemon.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"x64\Release\capemon_x64.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG:incremental /LTCGOUT:"x64\Release\capemon_x64.iobj" /TLBID:1 /RELEASE /DYNAMICBASE /NXCOMPAT /IMPLIB:"x64\Release\capemon_x64.lib" /MACHINE:X64 /DLL x64\Release\alloc.obj x64\Release\AmsiDumper.obj x64\Release\CAPE.obj x64\Release\Debugger.obj x64\Release\Injection.obj x64\Release\InstrCallback.obj x64\Release\Output.obj x64\Release\ScyllaHarness.obj x64\Release\ApiReader.obj x64\Release\DeviceNameResolver.obj x64\Release\IATReferenceScan.obj x64\Release\IATSearch.obj x64\Release\ImportRebuilder.obj x64\Release\ImportsHandling.obj x64\Release\NativeWinApi.obj x64\Release\PeParser.obj x64\Release\ProcessAccessHelp.obj x64\Release\StringConversion.obj x64\Release\SystemInformation.obj x64\Release\Trace.obj x64\Release\Unpacker.obj x64\Release\w64wow64.obj x64\Release\wow64_fix.obj x64\Release\YaraHarness.obj x64\Release\config.obj x64\Release\capemon.obj x64\Release\decoder.obj x64\Release\distorm.obj x64\Release\instructions.obj x64\Release\insts.obj x64\Release\mnemonics.obj x64\Release\operands.obj x64\Release\prefix.obj x64\Release\textdefs.obj x64\Release\wstring.obj x64\Release\hooking.obj x64\Release\hooking_32.obj x64\Release\hooking_64.obj x64\Release\hooks.obj x64\Release\hook_clr.obj x64\Release\hook_crypto.obj x64\Release\hook_file.obj x64\Release\hook_misc.obj x64\Release\hook_network.obj x64\Release\hook_process.obj x64\Release\hook_reg.obj x64\Release\hook_reg_native.obj x64\Release\hook_services.obj x64\Release\hook_sleep.obj x64\Release\hook_socket.obj x64\Release\hook_special.obj x64\Release\hook_sync.obj x64\Release\hook_thread.obj x64\Release\hook_tls.obj x64\Release\hook_window.obj x64\Release\ignore.obj x64\Release\log.obj x64\Release\lookup.obj x64\Release\misc.obj x64\Release\pipe.obj x64\Release\unhook.obj x64\Release\utf8.obj x64\Release\InstrHook64.obj

Build Command

git clone https://github.com/kevoreilly/capemon.git
cd capemon
REM It can be compiled after restoring libyara lib
REM git checkout 8bf93ca~ libyara\lib\libyara*.lib
msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.22621.0 /p:PlatformToolset=v143 capemon.sln /t:Rebuild

Build Env

fire-flying commented 10 months ago

I see from Build Command that you are using PlatformToolset vc143,capemon's vs project uses vc141_xp, you need to additionally install vc141_xp or vc_141 toolset

kevoreilly commented 10 months ago

Only v141 needed